Decompiled source of JLL v1.9.5
BepInEx/plugins/JLL/JLL.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; 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: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace JLL { [BepInPlugin("JacobG5.JLL", "JLL", "1.9.5")] [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.9.5"; 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; public static ConfigEntry<JLogLevel> loggingLevel; public static ConfigEntry<bool> purgeWesley; public static ConfigEntry<bool> 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, Assembly.GetExecutingAssembly().GetTypes()); loggingLevel = ((BaseUnityPlugin)this).Config.Bind<JLogLevel>("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<JNetworkPrefabSet>(); JLLNetworkPrefabs.SetName = "JLL"; JLLNetworkPrefabs.AddPrefabs(new JNetworkPrefabSet.JIdentifiablePrefab { name = "JLL", prefab = (networkObject = CreateNetworkPrefab("JLL")) }, new JNetworkPrefabSet.JIdentifiablePrefab { name = "EmptyPrefab", prefab = (JNetworkPrefabSet.EmptyNetworkObject = CreateNetworkPrefab("EmptyPrefab")) }); networkObject.AddComponent<JLLNetworkManager>(); JNetworkPrefabSet.NetworkPrefabSets.Add(JLLNetworkPrefabs); purgeWesley = ((BaseUnityPlugin)this).Config.Bind<bool>("Logging", "PurgeWesley", false, "Destroys him."); if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LCCutscene)) { disableCutscenes = ((BaseUnityPlugin)this).Config.Bind<bool>("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)); 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<NetworkObject>()).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<T> { public string configName = "Example"; public string configCategory = "Main"; public string configDescription = ""; public T defaultValue; } private static readonly List<JLLMod> m_ModList = new List<JLLMod>(); public string modAuthor = ""; public string modName = ""; [Header("Network Prefabs")] public JNetworkPrefabSet[] prefabSets = new JNetworkPrefabSet[0]; [Header("Config Values")] public List<ConfigValue<bool>> Booleans = new List<ConfigValue<bool>>(); public List<ConfigValue<string>> Strings = new List<ConfigValue<string>>(); public List<ConfigValue<int>> Integers = new List<ConfigValue<int>>(); public List<ConfigValue<float>> Floats = new List<ConfigValue<float>>(); [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<JLLMod> list = new List<JLLMod>(); 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/Collections/JLLModCollection", order = 20)] public class JLLModCollection : ScriptableObject { public JLLMod[] Mods = new JLLMod[0]; } [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<JNetworkPrefabSet> NetworkPrefabSets = new List<JNetworkPrefabSet>(); 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<JIdentifiablePrefab> 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<NetworkManager>(); List<GameObject> list = new List<GameObject>(); 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 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))] public class GameNetworkManagerPatch { private static bool registeredPrefabs; [HarmonyPatch("Start")] [HarmonyPostfix] public static void patchStart(GameNetworkManager __instance) { if (!registeredPrefabs) { registeredPrefabs = true; ((MonoBehaviour)__instance).StartCoroutine(RegisterNetworkPrefabs()); } } private static IEnumerator RegisterNetworkPrefabs() { yield return (object)new WaitUntil((Func<bool>)(() => JFileHelper.HaveJLLBundlesLoaded)); JNetworkPrefabSet.RegisterPrefabs(); } } [HarmonyPatch(typeof(HUDManager))] public class HudManagerPatch { 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<JWaterFilter>(ref customFilter); } } if ((Object)(object)customFilter == (Object)null && !localPlayer.isPlayerDead && (Object)(object)localPlayer.underwaterCollider != (Object)null) { ((Component)localPlayer.underwaterCollider).TryGetComponent<JWaterFilter>(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()); } private static IEnumerator TipQueueCheck() { yield return (object)new WaitForSeconds(5f); JHudHelper.isTipActive = false; JHudHelper.DisplayNextTip(); } } [HarmonyPatch(typeof(ItemCharger))] internal class ItemChargerPatch { [HarmonyPatch("chargeItemDelayed")] [HarmonyPrefix] public static void patchChargeItemDelayed(ItemCharger __instance) { ChargeLimiter chargeLimiter = default(ChargeLimiter); if (((Component)__instance).TryGetComponent<ChargeLimiter>(ref chargeLimiter)) { JLogHelper.LogInfo("Found Limiter"); chargeLimiter.Charge(); } } } [HarmonyPatch(typeof(ItemDropship))] internal 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<JItemDropshipModifier>(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<GrabbableObject>(ref val)) { JLogHelper.LogInfo("Found dropship item! " + val.itemProperties.itemName, JLogLevel.Wesley); jItemDropshipModifier.ModifyDroppedItems(val); } } } } } [HarmonyPatch(typeof(LungProp))] internal 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 class MenuManagerPatch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void patchStart() { JLevelPropertyRegistry.RemoveLevelOverrides(); } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("FinishGeneratingLevel")] [HarmonyPrefix] public static void spawnFinishGeneratingLevel() { JMaterialReplacer[] array = Object.FindObjectsOfType<JMaterialReplacer>(); 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<MonoBehaviour>().OfType<IDungeonLoadListener>().ToArray(); if (array.Length != 0) { for (int i = 0; i < array.Length; i++) { array[i].PostDungeonGeneration(); } } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartOfRound_Start(StartOfRound __instance) { if (((NetworkBehaviour)__instance).IsHost || ((NetworkBehaviour)__instance).IsServer) { GameObject val = Object.Instantiate<GameObject>(JLL.Instance.networkObject); val.GetComponent<NetworkObject>().Spawn(false); JLogHelper.LogInfo("JLL Network Manager Initialized.", JLogLevel.User); } ((MonoBehaviour)__instance).StartCoroutine(StoreDefaults()); } private static IEnumerator StoreDefaults() { yield return (object)new WaitForSeconds(0.5f); List<EnemyType> enemyTypes = new List<EnemyType>(); SelectableLevel allEnemiesLevel = Object.FindObjectOfType<QuickMenuManager>().testAllEnemiesLevel; FindEnemyTypes(allEnemiesLevel.Enemies, ref enemyTypes); FindEnemyTypes(allEnemiesLevel.OutsideEnemies, ref enemyTypes); FindEnemyTypes(allEnemiesLevel.DaytimeEnemies, ref enemyTypes); JLevelPropertyRegistry.AllSortedEnemies.Clear(); JLevelPropertyRegistry.AllSortedEnemies.AddRange(enemyTypes); } private static void FindEnemyTypes(List<SpawnableEnemyWithRarity> spawnableEnemies, ref List<EnemyType> 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(TimeOfDay))] internal 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(typeof(VehicleController))] public 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<BoxCollider>(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<PlayerControllerB>)(object)eventsForClient).Invoke(player); } else { eventsForEveryoneElse.Invoke(); } } } public class DamageTrigger : MonoBehaviour { [Serializable] public class DamageTarget<T> { public bool enabled = false; public int damage = 1; public bool applyDamageMultiplier = true; public bool playCustomSounds = true; public UnityEvent<T> hitEvent = new UnityEvent<T>(); 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 = (Transform[])(object)new Transform[0]; public LayerMask raycastMask = LayerMask.op_Implicit(1202194760); [Header("Targets")] public float damageMultiplier = 1f; [Tooltip("Players have 100 HP")] public DamageTarget<PlayerControllerB> playerTargets = new DamageTarget<PlayerControllerB>(); [Tooltip("Any instance of EnemyAICollisionDetect converted to EnemyAI")] public DamageTarget<EnemyAI> enemyTargets = new DamageTarget<EnemyAI>(); [Tooltip("The Company Cruiser has 30 HP")] public DamageTarget<VehicleController> vehicleTargets = new DamageTarget<VehicleController>(); [Tooltip("Anything that is damageable by shovels but not one of the things above")] public DamageTarget<IHittable> objectTargets = new DamageTarget<IHittable>(); [Header("SFX")] public bool playNormalDamageSFX = true; public AudioClip[] clips = (AudioClip[])(object)new AudioClip[0]; public AudioSource[] sources = (AudioSource[])(object)new AudioSource[0]; private readonly Dictionary<GameObject, int> collidersInside = new Dictionary<GameObject, int>(); private readonly List<GameObject> markedForRemoval = new List<GameObject>(); private readonly List<GameObject> foundInside = new List<GameObject>(); 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<GameObject, int> 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<GameObject, int> 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<PlayerControllerB>()); } break; case 1: if (enemyTargets.enabled) { DamageEnemy(target.GetComponent<EnemyAICollisionDetect>().mainScript); } break; case 2: if (vehicleTargets.enabled) { DamageVehicle(target.GetComponent<VehicleController>()); } break; case 3: if (objectTargets.enabled) { DamageObject(target.GetComponent<IHittable>()); } break; } } public static bool IsTargetDead(GameObject target, int type) { if (1 == 0) { } bool result = type switch { 0 => target.GetComponent<PlayerControllerB>().isPlayerDead, 1 => target.GetComponent<EnemyAICollisionDetect>().mainScript.isEnemyDead, 2 => target.GetComponent<VehicleController>().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<PlayerControllerB>(ref val)) { return 0; } } else if (target.CompareTag("Enemy")) { EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (target.TryGetComponent<EnemyAICollisionDetect>(ref val2)) { return 1; } } else { VehicleController val3 = default(VehicleController); if (target.TryGetComponent<VehicleController>(ref val3)) { return 2; } IHittable val4 = default(IHittable); if (target.TryGetComponent<IHittable>(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<PlayerCorpse> playerCorpses = new List<PlayerCorpse>(); private readonly List<PlayerCorpse> removeCorpses = new List<PlayerCorpse>(); 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) 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)) { 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_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)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } 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<PlayerControllerB>)(object)PlayerKilled).Invoke(playerCorpse.player); } break; case 1: EnemyKilled.Invoke(); break; case 2: VehicleKilled.Invoke(); break; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_DamageTriggerNetworking() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1067576157u, new RpcReceiveHandler(__rpc_handler_1067576157)); NetworkManager.__rpc_func_table.Add(3711696475u, new RpcReceiveHandler(__rpc_handler_3711696475)); NetworkManager.__rpc_func_table.Add(3159405848u, new RpcReceiveHandler(__rpc_handler_3159405848)); } 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)2; ((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 = (AudioClip[])(object)new AudioClip[0]; public AudioSource[] sources = (AudioSource[])(object)new AudioSource[0]; [Header("Player")] public InteractEvent OnPlayerDamaged = new InteractEvent(); private List<PlayerControllerB> playersInside = new List<PlayerControllerB>(); private List<EnemyAI> creaturesInside = new List<EnemyAI>(); private List<VehicleController> vehiclesInside = new List<VehicleController>(); private List<IHittable> objectsInside = new List<IHittable>(); public void OnTriggerEnter(Collider collider) { switch (DamageTarget(((Component)collider).gameObject, damageOnEnter)) { case 0: playersInside.Add(((Component)collider).GetComponent<PlayerControllerB>()); break; case 1: creaturesInside.Add(((Component)collider).GetComponent<EnemyAICollisionDetect>().mainScript); break; case 2: vehiclesInside.Add(((Component)collider).GetComponent<VehicleController>()); break; case 3: objectsInside.Add(((Component)collider).GetComponent<IHittable>()); break; } } public void OnTriggerExit(Collider collider) { switch (DamageTarget(((Component)collider).gameObject, damageOnExit)) { case 0: playersInside.Remove(((Component)collider).GetComponent<PlayerControllerB>()); break; case 1: creaturesInside.Remove(((Component)collider).GetComponent<EnemyAICollisionDetect>().mainScript); break; case 2: vehiclesInside.Remove(((Component)collider).GetComponent<VehicleController>()); break; case 3: objectsInside.Remove(((Component)collider).GetComponent<IHittable>()); 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<PlayerControllerB>(ref val)) { if (condition && damagePlayers && !val.isPlayerDead) { DamagePlayer(val); } return 0; } } else if (target.CompareTag("Enemy")) { EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (target.TryGetComponent<EnemyAICollisionDetect>(ref val2)) { if (condition && damageEnemies && !val2.mainScript.isEnemyDead) { DamageEnemy(val2.mainScript); } return 1; } } else { VehicleController val3 = default(VehicleController); if (target.TryGetComponent<VehicleController>(ref val3)) { if (condition && damageVehicles && !val3.carDestroyed) { DamageVehicle(val3); } return 2; } IHittable obj = default(IHittable); if (target.TryGetComponent<IHittable>(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<PlayerControllerB>)(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<Animator>(); } 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<QueuedEvent> queuedEvents = new List<QueuedEvent>(); private readonly List<QueuedEvent> expiredEvents = new List<QueuedEvent>(); 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<PlayerControllerB>)(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 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<WeightedEnemyRefrence> randomPool = new List<WeightedEnemyRefrence>(); 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 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_0193: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: 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) { 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<EnemyAI>(ref val3)) { ((UnityEvent<EnemyAI>)(object)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 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<PlayerControllerB>)(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) { IWeightedItem[] weightedItems2 = weightedItems; return GetRandomIndex(Random.Range(0, weightedItems2.CombinedWeights() + 1), weightedItems2, () => Random.Range(0, weightedItems2.Length)); } static int GetRandomIndex(Random random, IWeightedItem[] weightedItems) { Random random2 = random; IWeightedItem[] weightedItems2 = weightedItems; return GetRandomIndex(random2.Next(0, weightedItems2.CombinedWeights() + 1), weightedItems2, () => random2.Next(0, weightedItems2.Length)); } private static int GetRandomIndex(int random, IWeightedItem[] weightedItems, Func<int> 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 = new ItemFilter.Properties[0]; public bool removeAllInstances = false; public void RemoveItems(PlayerControllerB player) { 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) { for (int i = 0; i < itemsToRemove.Length; i++) { if (player.ItemSlots[slot].itemProperties.itemName.ToLower() == itemsToRemove[i].ToLower()) { player.DestroyItemInSlotAndSync(slot); return true; } } for (int j = 0; j < removeByFilter.Length; j++) { if (removeByFilter[j].Check(player.ItemSlots[slot])) { player.DestroyItemInSlotAndSync(slot); return true; } } return false; } } public class ItemConsumer : NetworkBehaviour { public Item[] validItems = (Item[])(object)new Item[0]; public bool checkExact = false; public ItemFilter.Properties[] validItemFilters = new ItemFilter.Properties[0]; 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) 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; } 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; bool flag = val3.IsLocalPlayer(); if (flag) { val3.DestroyItemInSlotAndSync(val3.currentItemSlot); } if (runEventOnAllClients || flag) { ((UnityEvent<PlayerControllerB>)(object)OnSuccess).Invoke(val3); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ItemConsumer() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2913302232u, new RpcReceiveHandler(__rpc_handler_2913302232)); NetworkManager.__rpc_func_table.Add(2753840628u, new RpcReceiveHandler(__rpc_handler_2753840628)); } 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)2; ((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<WeightedItemRefrence> list = new List<WeightedItemRefrence>(); 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<KeyValuePair<GrabbableObject, int>> 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<KeyValuePair<GrabbableObject, int>> list = new List<KeyValuePair<GrabbableObject, int>>(); 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<GrabbableObject, int>(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<GameObject>(item.spawnPrefab, pos, EnemySpawner.GetRot(rotation, sourceRot), parent).GetComponent<GrabbableObject>(); 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 = tru
BepInEx/plugins/JLL/JLLEditorModule.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using JLL.Components; using JLLItemsModule.Components; using Unity.Netcode; using UnityEditor; using UnityEditorInternal; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("JLLEditorModule")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("JLLEditorModule")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("820f0e1c-80f5-436f-8641-0f048baeb385")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace JLLEditorModule { public class JLLEditor { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static HeaderCallbackDelegate <>9__4_2; public static HeaderCallbackDelegate <>9__6_2; internal void <CreateWeightedItemSpawnProperties>b__4_2(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Custom Item List")); } internal void <CreateWeightedEnemySpawnProperties>b__6_2(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Custom Enemy List")); } } public static void HelpMessage(params string[] messages) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown if (messages.Length > 1) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < messages.Length; i++) { stringBuilder.Append(messages[i]); if (i < messages.Length - 1) { stringBuilder.Append("\n\n"); } } EditorGUILayout.HelpBox(new GUIContent(stringBuilder.ToString()), true); } else if (messages.Length == 1) { EditorGUILayout.HelpBox(new GUIContent(messages[0]), true); } } public static Rect GetElementRect(Rect rect, int index, float seperation = 5f) { //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_002d: Unknown result type (might be due to invalid IL or missing references) return new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + GetElementRectHeight(index, seperation) + seperation, ((Rect)(ref rect)).width, EditorGUIUtility.singleLineHeight); } public static Rect GetElementRect(Rect rect, int columns, Vector2Int location, float seperation = 5f) { //IL_0040: 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_0048: Unknown result type (might be due to invalid IL or missing references) return new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width / (float)columns * (float)((Vector2Int)(ref location)).x, ((Rect)(ref rect)).y + GetElementRectHeight(((Vector2Int)(ref location)).y, seperation), ((Rect)(ref rect)).width / (float)columns, EditorGUIUtility.singleLineHeight); } public static float GetElementRectHeight(int index, float seperation = 5f) { return (EditorGUIUtility.singleLineHeight + seperation) * (float)index; } public static ReorderableList CreateWeightedItemSpawnProperties(SerializedObject obj, SerializedProperty CustomList) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_005c: 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_0067: Expected O, but got Unknown ReorderableList weightedProperties = new ReorderableList(obj, CustomList); weightedProperties.drawElementCallback = (ElementCallbackDelegate)delegate(Rect rect, int index, bool isActive, bool isFocused) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) WeightedItemProperty(weightedProperties.serializedProperty.GetArrayElementAtIndex(index), rect); }; weightedProperties.elementHeightCallback = (ElementHeightCallbackDelegate)((int index) => GetElementRectHeight((weightedProperties.serializedProperty.GetArrayElementAtIndex(index).FindPropertyRelative("ItemName").stringValue == "") ? 6 : 4) + 5f); ReorderableList obj2 = weightedProperties; object obj3 = <>c.<>9__4_2; if (obj3 == null) { HeaderCallbackDelegate val = delegate(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Custom Item List")); }; <>c.<>9__4_2 = val; obj3 = (object)val; } obj2.drawHeaderCallback = (HeaderCallbackDelegate)obj3; return weightedProperties; } public static void WeightedItemProperty(SerializedProperty item, Rect rect) { //IL_000f: 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_007e: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) //IL_005c: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) int num = 0; SerializedProperty val = item.FindPropertyRelative("ItemName"); EditorGUI.PropertyField(GetElementRect(rect, num++), val); if (val.stringValue == "") { EditorGUI.PropertyField(GetElementRect(rect, num++), item.FindPropertyRelative("Item")); EditorGUI.PropertyField(GetElementRect(rect, num++), item.FindPropertyRelative("FindRegisteredItem")); } EditorGUI.PropertyField(GetElementRect(rect, num++), item.FindPropertyRelative("Weight")); SerializedProperty val2 = item.FindPropertyRelative("OverrideValue"); EditorGUI.PropertyField(GetElementRect(rect, 2, new Vector2Int(0, num)), val2); if (val2.boolValue) { EditorGUI.PropertyField(GetElementRect(rect, 2, new Vector2Int(1, num)), item.FindPropertyRelative("ScrapValue"), GUIContent.none); } num++; EditorGUI.PropertyField(GetElementRect(rect, num++), item.FindPropertyRelative("SpawnOffset")); } public static ReorderableList CreateWeightedEnemySpawnProperties(SerializedObject obj, SerializedProperty CustomList) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_005c: 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_0067: Expected O, but got Unknown ReorderableList weightedProperties = new ReorderableList(obj, CustomList); weightedProperties.drawElementCallback = (ElementCallbackDelegate)delegate(Rect rect, int index, bool isActive, bool isFocused) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) WeightedEnemyProperty(weightedProperties.serializedProperty.GetArrayElementAtIndex(index), rect); }; weightedProperties.elementHeightCallback = (ElementHeightCallbackDelegate)((int index) => GetElementRectHeight((weightedProperties.serializedProperty.GetArrayElementAtIndex(index).FindPropertyRelative("enemyName").stringValue == "") ? 3 : 2) + 5f); ReorderableList obj2 = weightedProperties; object obj3 = <>c.<>9__6_2; if (obj3 == null) { HeaderCallbackDelegate val = delegate(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Custom Enemy List")); }; <>c.<>9__6_2 = val; obj3 = (object)val; } obj2.drawHeaderCallback = (HeaderCallbackDelegate)obj3; return weightedProperties; } public static void WeightedEnemyProperty(SerializedProperty enemy, Rect rect) { //IL_000f: 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_0058: 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_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) int num = 0; SerializedProperty val = enemy.FindPropertyRelative("enemyName"); EditorGUI.PropertyField(GetElementRect(rect, num++), val); if (string.IsNullOrEmpty(val.stringValue)) { EditorGUI.PropertyField(GetElementRect(rect, num++), enemy.FindPropertyRelative("enemyType")); } EditorGUI.PropertyField(GetElementRect(rect, num++), enemy.FindPropertyRelative("rarity")); } public static bool ObjectIsParent(GameObject target, Transform search) { if ((Object)(object)((Component)search).transform.parent != (Object)null) { if ((Object)(object)((Component)((Component)search).transform.parent).gameObject == (Object)(object)target) { return true; } return ObjectIsParent(target, ((Component)search).transform.parent); } return false; } } } namespace JLLEditorModule.EditorScripts { [CustomEditor(typeof(JBridgeTrigger))] [CanEditMultipleObjects] public class JBridgeTriggerEditor : JLLCustomEditor<JBridgeTrigger> { public override void AtHeader() { base.AtHeader(); bool flag = false; Collider[] components = ((Component)Component).gameObject.GetComponents<Collider>(); foreach (Collider val in components) { if (val.isTrigger) { flag = true; break; } } if (!flag || (Object)(object)Component.bridgeAnimator == (Object)null || (Object)(object)Component.bridgeAudioSource == (Object)null) { JLLEditor.HelpMessage("This script is missing properties that are required for this component to function", "It is recomended to base this off of the vanilla bridges on Vow or Adamance to ensure it is set up correctly."); } WarnVehicleLayer("If you intend for this bridge to be collapsable by cruisers then you need to set the colliders to a layer that can interact with cruisers"); } public override bool DisplayProperty(SerializedProperty property) { return true; } } [CustomEditor(typeof(DamageTrigger))] [CanEditMultipleObjects] public class DamageTriggerEditor : JLLCustomEditor<DamageTrigger> { private int indent = 0; public override void AtHeader() { base.AtHeader(); CheckForColliders(); } public override bool DisplayProperty(SerializedProperty property) { if ((Object)(object)Component.DamageTriggerNetworking == (Object)null && (property.name == "attachCorpseToPoint" || property.name == "OverrideCorpseMesh")) { return false; } if (!Component.attachCorpseToPoint || (Object)(object)Component.DamageTriggerNetworking == (Object)null) { if (property.name == "corpseAttachPoint" || property.name == "matchPointExactly" || property.name == "corpseStickTime" || property.name == "connectedBone") { return false; } } else if (indent == 0) { if (property.name == "attachCorpseToPoint") { indent++; } else if (property.name == "corpseStickTime") { indent--; } } else { EditorGUI.indentLevel += indent; indent = 0; } return true; } public override void DisplayWarnings(SerializedProperty property) { if (property.name == "vehicleTargets" && Component.vehicleTargets.enabled) { WarnVehicleLayer("In order to damage Vehicles you will need to make sure your colliders / Layermasks can interact with the vehicle layer."); } if (!hasCollider && property.name == "damageOnCollision" && Component.damageOnCollision) { JLLEditor.HelpMessage("'damageOnCollision' requires a collider on the same object that has 'isTrigger' disabled."); } if (!hasTriggerCollider) { if (property.name == "damageOnEnter" && Component.damageOnEnter) { JLLEditor.HelpMessage("'damageOnEnter' requires a collider on the same object that has 'isTrigger' enabled."); } else if (property.name == "damageOnExit" && Component.damageOnExit) { JLLEditor.HelpMessage("'damageOnExit' requires a collider on the same object that has 'isTrigger' enabled."); } else if (property.name == "continuousDamage" && Component.continuousDamage) { JLLEditor.HelpMessage("'continuousDamage' requires a collider on the same object that has 'isTrigger' enabled."); } } if (property.name == "continuousRaycastDamage" && Component.continuousRaycastDamage && Component.raycastDirections.Length == 0) { JLLEditor.HelpMessage("'continuousRaycastDamage' requires at least one raycast direction to be defined in 'raycastDirections'."); } } } [CustomEditor(typeof(JBillboard))] [CanEditMultipleObjects] public class JBillboardEditor : JLLCustomEditor<JBillboard> { public override bool DisplayProperty(SerializedProperty property) { if (property.name == "LerpSpeed") { return Component.LerpRot; } return true; } } [CustomEditor(typeof(JDestructableObject))] [CanEditMultipleObjects] public class JDestructableObjectEditor : JLLCustomEditor<JDestructableObject> { public override bool DisplayProperty(SerializedProperty property) { return true; } public override void AtHeader() { base.AtHeader(); if ((0x40A80948 & (1 << ((Component)Component).gameObject.layer)) > 0) { JLLEditor.HelpMessage(LayerMask.LayerToName(((Component)Component).gameObject.layer) + " Layer may not be acceptable for most weapons.", "Depending on your intended behavior I recomend setting the layer of this object to either Enemies or MapHazards", "The Collision Matrix can be found at: ProjectSettings/Physics/LayerCollisionMatrix"); } } } [CustomEditor(typeof(JClientAttatchedObject))] [CanEditMultipleObjects] public class JClientAttatchedObjectEditor : JLLCustomEditor<JClientAttatchedObject> { public override bool DisplayProperty(SerializedProperty property) { if (property.name == "lerpPosition" && !Component.attachToLocalPlayer) { return false; } return true; } public override void DisplayWarnings(SerializedProperty property) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (property.name == "target") { if ((Object)(object)Component.target == (Object)null) { JLLEditor.HelpMessage("Target Object being null will not move anything.", "Please put the object you want this script to effect in the Target field."); } else if ((int)Component.enableCondition != 0 && ((Object)(object)((Component)Component).gameObject == (Object)(object)Component.target || JLLEditor.ObjectIsParent(Component.target, ((Component)Component).transform))) { JLLEditor.HelpMessage("Target should not be self or parent when an Enable Condition is set.", "Disabling the object containing this script will stop it from working."); } } } } public abstract class JLLCustomEditor<T> : Editor where T : MonoBehaviour { public T Component; public bool hasTriggerCollider = false; public bool hasCollider = false; public virtual void OnEnable() { Component = (T)(object)((Editor)this).target; } public override void OnInspectorGUI() { ((Editor)this).serializedObject.Update(); AtHeader(); SerializedProperty iterator = ((Editor)this).serializedObject.GetIterator(); bool flag = true; int num = 0; while (iterator.NextVisible(flag)) { if (flag) { flag = false; } else if (DisplayProperty(iterator)) { EditorGUILayout.PropertyField(iterator, Array.Empty<GUILayoutOption>()); DisplayWarnings(iterator); } num++; } AtFooter(); ((Editor)this).serializedObject.ApplyModifiedProperties(); } public virtual void AtHeader() { object obj = Component; NetworkBehaviour val = (NetworkBehaviour)((obj is NetworkBehaviour) ? obj : null); if (val != null && (Object)(object)((Component)val).GetComponent<NetworkObject>() == (Object)null) { JLLEditor.HelpMessage("Network Behaviours require a Network Object to run some of their code. Ensure you have a Network Object attatched to this script in some way."); } } public void CheckForColliders() { hasTriggerCollider = false; hasCollider = false; Collider[] components = ((Component)(object)Component).gameObject.GetComponents<Collider>(); foreach (Collider val in components) { if (val.isTrigger) { hasTriggerCollider = true; } else { hasCollider = true; } if (hasTriggerCollider && hasCollider) { break; } } } public abstract bool DisplayProperty(SerializedProperty property); public virtual void DisplayWarnings(SerializedProperty property) { } public static bool IsInLayerMask(int layer, LayerMask mask) { return (((LayerMask)(ref mask)).value & (1 << layer)) != 0; } public void WarnIncompatibleLayer(GameObject gameObject, int layer, bool checkColliderOverrides, params string[] messages) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) bool flag = false; bool flag2 = false; if (checkColliderOverrides) { Collider[] components = gameObject.GetComponents<Collider>(); foreach (Collider val in components) { if (val.layerOverridePriority > 0) { if (IsInLayerMask(layer, val.includeLayers)) { flag = true; } if (IsInLayerMask(layer, val.excludeLayers)) { flag2 = true; } } } } if (!flag && (Physics.GetIgnoreLayerCollision(gameObject.layer, layer) || flag2)) { List<string> list = new List<string> { LayerMask.LayerToName(gameObject.layer) + " Layer does not interact with the $" + LayerMask.LayerToName(layer) + " Layer." }; list.AddRange(messages); list.Add("The Collision Matrix can be found at: ProjectSettings/Physics/LayerCollisionMatrix"); JLLEditor.HelpMessage(list.ToArray()); } } public void WarnVehicleLayer(params string[] messages) { WarnIncompatibleLayer(((Component)(object)Component).gameObject, 30, checkColliderOverrides: true, messages); } public virtual void AtFooter() { } } [CustomEditor(typeof(JNetworkPrefabSpawner))] [CanEditMultipleObjects] public class JNetworkPrefabSpawnerEditor : JLLCustomEditor<JNetworkPrefabSpawner> { public override bool DisplayProperty(SerializedProperty property) { if (Component.spawnRandom && property.name == "spawnPrefabName") { return false; } return true; } } [CustomEditor(typeof(JPlayerInsideRegion))] [CanEditMultipleObjects] public class JPlayerInsideRegionEditor : JLLCustomEditor<JPlayerInsideRegion> { public override bool DisplayProperty(SerializedProperty property) { if (!Component.limitEventTriggers && property.name == "maxEventTriggers") { return false; } return true; } } [CustomEditor(typeof(JMeleeWeapon))] [CanEditMultipleObjects] public class JMeleeWeaponEditor : JLLCustomEditor<JMeleeWeapon> { public override bool DisplayProperty(SerializedProperty property) { if (!Component.isHeavyWeapon && (property.name == "reelingTime" || property.name == "swingTime" || property.name == "reelUpSFX")) { return false; } if (property.name == "OnPlayerHit" && !Component.damagePlayers) { return false; } if (property.name == "OnEnemyHit" && !Component.damageEnemies) { return false; } if (property.name == "OnVehicleHit" && !Component.damageVehicles) { return false; } if (property.name == "OnObjectHit" && !Component.damageObjects) { return false; } return true; } } [CustomEditor(typeof(JEventBoxItem))] [CanEditMultipleObjects] public class JEventBoxItemEditor : JLLCustomEditor<JEventBoxItem> { private SerializedProperty CustomList; private ReorderableList weightedProperties; public override void OnEnable() { base.OnEnable(); CustomList = ((Editor)this).serializedObject.FindProperty("CustomList"); weightedProperties = JLLEditor.CreateWeightedItemSpawnProperties(((Editor)this).serializedObject, CustomList); } public override void AtHeader() { base.AtHeader(); WeightedItemRefrence[] customList = Component.CustomList; foreach (WeightedItemRefrence val in customList) { if (val.ItemName != "") { val.Item = null; } } } public override bool DisplayProperty(SerializedProperty property) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if (property.name == "CustomList") { if ((int)Component.SourcePool == 0) { weightedProperties.DoLayoutList(); } return false; } return true; } } [CustomEditor(typeof(JRandomPropPlacer))] [CanEditMultipleObjects] public class JRandomPropPlacerEditor : JLLCustomEditor<JRandomPropPlacer> { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static HeaderCallbackDelegate <>9__4_2; internal void <CreateSpawnablePropProperties>b__4_2(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Spawnable Props")); } } private SerializedProperty SpawnablePropsList; private ReorderableList spawnablePropProperties; public override void OnEnable() { base.OnEnable(); SpawnablePropsList = ((Editor)this).serializedObject.FindProperty("spawnableProps"); spawnablePropProperties = CreateSpawnablePropProperties(((Editor)this).serializedObject, SpawnablePropsList); } public override bool DisplayProperty(SerializedProperty property) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 if (property.name == "rebakeSurfaces" && (int)Component.rebakeNavMesh != -1) { return false; } if (property.name == "spawnableProps") { spawnablePropProperties.DoLayoutList(); return false; } return true; } public ReorderableList CreateSpawnablePropProperties(SerializedObject obj, SerializedProperty CustomList) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown ReorderableList weightedProperties = new ReorderableList(obj, CustomList); weightedProperties.drawElementCallback = (ElementCallbackDelegate)delegate(Rect rect, int index, bool isActive, bool isFocused) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) SpawnablePropProperty(weightedProperties.serializedProperty.GetArrayElementAtIndex(index), rect); }; weightedProperties.elementHeightCallback = (ElementHeightCallbackDelegate)((int index) => JLLEditor.GetElementRectHeight(((int)Component.spawnableProps[index].spawnRotation == 3) ? 7 : 6) + 5f); ReorderableList obj2 = weightedProperties; object obj3 = <>c.<>9__4_2; if (obj3 == null) { HeaderCallbackDelegate val = delegate(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EditorGUI.LabelField(rect, new GUIContent("Spawnable Props")); }; <>c.<>9__4_2 = val; obj3 = (object)val; } obj2.drawHeaderCallback = (HeaderCallbackDelegate)obj3; return weightedProperties; } public static void SpawnablePropProperty(SerializedProperty item, Rect rect) { //IL_0003: 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_0024: 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_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_0098: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00e5: 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_0081: Unknown result type (might be due to invalid IL or missing references) int num = 0; EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("prefabToSpawn")); EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("randomAmount")); SerializedProperty val = item.FindPropertyRelative("spawnRotation"); EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), val); if (val.enumValueFlag == 3) { EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("spawnFlushAgainstWall")); } EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("distanceFromEntrances")); EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("distanceBetweenSpawns")); EditorGUI.PropertyField(JLLEditor.GetElementRect(rect, num++), item.FindPropertyRelative("randomSpawnRange")); } } [CustomEditor(typeof(ModLoadedCheck))] [CanEditMultipleObjects] public class ModLoadedCheckEditor : JLLCustomEditor<ModLoadedCheck> { public override bool DisplayProperty(SerializedProperty property) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 if (property.name == "modGUID" && (int)Component.checkedMod != -1) { return false; } return true; } } [CustomEditor(typeof(RandomizedEvent))] [CanEditMultipleObjects] public class RandomizedEventEditor : JLLCustomEditor<RandomizedEvent> { public override bool DisplayProperty(SerializedProperty property) { return true; } } [CustomEditor(typeof(RandomClipPlayer))] [CanEditMultipleObjects] public class RandomClipPlayerEditor : JLLCustomEditor<RandomClipPlayer> { public override bool DisplayProperty(SerializedProperty property) { if (!Component.walkieCanHear && property.name == "walkieVolumeMultiplier") { return false; } if (!Component.creaturesCanHear && (property.name == "creatureVolumeMultiplier" || property.name == "creatureRangeMultiplier")) { return false; } return true; } } [CustomEditor(typeof(TerrainObstacle))] [CanEditMultipleObjects] public class TerrainObstacleEditor : JLLCustomEditor<TerrainObstacle> { public override void AtHeader() { base.AtHeader(); WarnVehicleLayer("In order for this script to work you will need to make sure your colliders / Layermasks can interact with the vehicle layer."); MeshCollider val = default(MeshCollider); if (((Component)Component).TryGetComponent<MeshCollider>(ref val)) { JLLEditor.HelpMessage("Mesh Colliders may cause problems being detected by other scripts.", "Please consider using a different type of collider for use with TerrainObstacles."); } } public override bool DisplayProperty(SerializedProperty property) { return true; } } [CustomEditor(typeof(JThrowableItem))] [CanEditMultipleObjects] public class JThrowableItemEditor : JLLCustomEditor<JThrowableItem> { private SerializedProperty CustomList; private ReorderableList weightedProperties; public override void OnEnable() { base.OnEnable(); CustomList = ((Editor)this).serializedObject.FindProperty("CustomList"); weightedProperties = JLLEditor.CreateWeightedItemSpawnProperties(((Editor)this).serializedObject, CustomList); } public override void AtHeader() { base.AtHeader(); WeightedItemRefrence[] customList = Component.CustomList; foreach (WeightedItemRefrence val in customList) { if (val.ItemName != "") { val.Item = null; } } } public override bool DisplayProperty(SerializedProperty property) { //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Invalid comparison between Unknown and I4 if (!Component.damageOnExplode && (property.name == "killDistance" || property.name == "damageRange" || property.name == "nonLethalDamage" || property.name == "pushForce" || property.name == "goThroughCar")) { return false; } if (!Component.stunOnExplode && (property.name == "affectAudio" || property.name == "flashSeverityMultiplier" || property.name == "enemyStunTime" || property.name == "flashSeverityDistanceRolloff")) { return false; } if (!Component.spawnItemsOnExplode && (property.name == "numberToSpawn" || property.name == "SourcePool" || property.name == "SpawnOffsets")) { return false; } if (property.name == "CustomList") { if (Component.spawnItemsOnExplode && (int)Component.SourcePool == 0) { weightedProperties.DoLayoutList(); } return false; } return true; } } [CustomEditor(typeof(JWeatherObject))] [CanEditMultipleObjects] public class JWeatherObjectEditor : JLLCustomEditor<JWeatherObject> { public override bool DisplayProperty(SerializedProperty property) { if (property.name == "defaultToSelf" && (Object)(object)Component.activeObject != (Object)null) { return false; } return true; } } [CustomEditor(typeof(ItemSpawner))] [CanEditMultipleObjects] public class ItemSpawnerEditor : JLLCustomEditor<ItemSpawner> { private SerializedProperty CustomList; private ReorderableList weightedProperties; public override void OnEnable() { base.OnEnable(); CustomList = ((Editor)this).serializedObject.FindProperty("CustomList"); weightedProperties = JLLEditor.CreateWeightedItemSpawnProperties(((Editor)this).serializedObject, CustomList); } public override void AtHeader() { base.AtHeader(); WeightedItemRefrence[] customList = Component.CustomList; foreach (WeightedItemRefrence val in customList) { if (val.ItemName != "") { val.Item = null; } } } public override bool DisplayProperty(SerializedProperty property) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if (property.name == "CustomList") { if ((int)Component.SourcePool == 0) { weightedProperties.DoLayoutList(); } return false; } return true; } } [CustomEditor(typeof(EnemySpawner))] [CanEditMultipleObjects] public class EnemySpawnerEditor : JLLCustomEditor<EnemySpawner> { private SerializedProperty randomPool; private ReorderableList weightedProperties; public override void OnEnable() { base.OnEnable(); randomPool = ((Editor)this).serializedObject.FindProperty("randomPool"); weightedProperties = JLLEditor.CreateWeightedEnemySpawnProperties(((Editor)this).serializedObject, randomPool); } public override void AtHeader() { base.AtHeader(); if (!string.IsNullOrEmpty(Component.enemyName)) { Component.type = null; } foreach (WeightedEnemyRefrence item in Component.randomPool) { if (!string.IsNullOrEmpty(item.enemyName)) { item.enemyType = null; } } } public override bool DisplayProperty(SerializedProperty property) { if (Component.spawnRandom) { if (property.name == "randomPool") { weightedProperties.DoLayoutList(); return false; } if (property.name == "type" || property.name == "enemyName") { return false; } } else if (property.name == "randomPool" || (property.name == "type" && !string.IsNullOrEmpty(Component.enemyName))) { return false; } return true; } } } namespace JLLEditorModule.EditorScripts.Components { [ExecuteInEditMode] public class PurgeChildren : MonoBehaviour { public bool Execute = false; public int split = 2; public void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (!Execute) { return; } Execute = false; GameObject val = new GameObject("Container"); val.transform.parent = ((Component)this).transform; List<Transform> list = new List<Transform>(); for (int i = split; i < ((Component)this).transform.childCount; i += split) { list.Add(((Component)this).transform.GetChild(i)); } foreach (Transform item in list) { item.SetParent(val.transform); } } } }
BepInEx/plugins/JLL/JLLItemsModule.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using JLL; using JLL.API; using JLL.API.Events; using JLL.Components; using JLL.Patches; using JLLItemsModule.Components; using JLLItemsModule.NetcodePatcher; using JLLItemsModule.Patches; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; [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("JLLItemsModule")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("JLLItemsModule")] [assembly: AssemblyTitle("JLLItemsModule")] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace JLLItemsModule { [BepInPlugin("JacobG5.JLLItemModule", "JLLItemModule", "1.3.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class JLLItemsCore : BaseUnityPlugin { private const string modGUID = "JacobG5.JLLItemModule"; private const string modName = "JLLItemModule"; private const string modVersion = "1.3.3"; private readonly Harmony harmony = new Harmony("JacobG5.JLLItemModule"); public void Awake() { JLL.NetcodePatch(JLogHelper.GetSource(), Assembly.GetExecutingAssembly().GetTypes()); JLL.HarmonyPatch(harmony, JLogHelper.GetSource(), new Type[2] { typeof(PlayerPatch), typeof(DepositItemsDeskPatch) }); } } } namespace JLLItemsModule.Patches { [HarmonyPatch(typeof(DepositItemsDesk))] internal class DepositItemsDeskPatch { [HarmonyPatch("AddObjectToDeskClientRpc")] [HarmonyPostfix] public static void patchAddObjectToDeskClientRpc(NetworkObjectReference grabbableObjectNetObject) { NetworkObject val = default(NetworkObject); JGrabbableObject jGrabbableObject = default(JGrabbableObject); if (((NetworkObjectReference)(ref grabbableObjectNetObject)).TryGet(ref val, (NetworkManager)null) && ((Component)val).TryGetComponent<JGrabbableObject>(ref jGrabbableObject)) { jGrabbableObject.PlacedOnDepositDesk(); jGrabbableObject.OnPlacedOnDepositDesk.Invoke(); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerPatch { [HarmonyPatch("SetItemInElevator")] [HarmonyPrefix] public static void patchSetItemInElevator(bool droppedInShipRoom, bool droppedInElevator, GrabbableObject gObject) { if (gObject.isInShipRoom != droppedInShipRoom && gObject is JGrabbableObject jGrabbableObject) { jGrabbableObject.OnSetInsideShip(droppedInShipRoom); ((UnityEvent<bool>)(object)jGrabbableObject.OnSetInShip).Invoke(droppedInShipRoom); } } } } namespace JLLItemsModule.Components { public class JEventBoxItem : JGrabbableObject { [Header("Event Box")] public bool canOpenInOrbit = true; public int boxUses = 1; public bool destroyWhenEmpty = true; private float lastUsedTime = 0f; public float openCooldown = 0.4f; public PlayerEvent OpenEvent = new PlayerEvent(); public WeightedEvent[] RandomOpenEvent = (WeightedEvent[])(object)new WeightedEvent[1] { new WeightedEvent { Weight = 20 } }; [Header("Item Spawner")] public bool spawnItemsOnOpen = true; public int numberToSpawn = 1; public SpawnPoolSource SourcePool = (SpawnPoolSource)0; public WeightedItemRefrence[] CustomList = (WeightedItemRefrence[])(object)new WeightedItemRefrence[1] { new WeightedItemRefrence() }; [Header("Audio & FX")] public ParticleSystem? PoofParticle; public AudioSource? BoxAudio; public AudioClip? OpenBoxClip; private PlayerControllerB previousPlayerHeldBy; public override void Start() { ((GrabbableObject)this).Start(); WeightedItemRefrence[] customList = CustomList; foreach (WeightedItemRefrence val in customList) { val.FindRegistered(); } } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); boxUses = saveData; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return boxUses; } public override void EquipItem() { base.EquipItem(); previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((canOpenInOrbit || !StartOfRound.Instance.inShipPhase) && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && boxUses > 0 && Time.realtimeSinceStartup - lastUsedTime > openCooldown) { lastUsedTime = Time.realtimeSinceStartup; ((GrabbableObject)this).playerHeldBy.activatingItem = true; if (((NetworkBehaviour)this).IsOwner) { OpenGiftBoxServerRpc(); } } } public override void PocketItem() { base.PocketItem(); ((GrabbableObject)this).playerHeldBy.activatingItem = false; } [ServerRpc(RequireOwnership = false)] public void OpenGiftBoxServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1900567855u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1900567855u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } boxUses--; int num = -1; if (RandomOpenEvent.Length != 0) { IWeightedItem[] randomOpenEvent = (IWeightedItem[])(object)RandomOpenEvent; num = IWeightedItem.GetRandomIndex(randomOpenEvent); if (!RandomOpenEvent[num].SendClientRPC) { InvokeRandomEvent(num); num = -1; } } if (spawnItemsOnOpen) { SpawnItemsOnServer(numberToSpawn); } OpenBoxClientRpc(num, boxUses); } public virtual void SpawnItemsOnServer(int amount) { SpawnItemsServerRpc(amount); } [ServerRpc(RequireOwnership = false)] private void SpawnItemsServerRpc(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_00cf: 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_00de: 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) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2647915572u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2647915572u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } Vector3 val3 = ((Component)this).transform.position + Vector3.up * 0.25f; Transform val4 = ((((!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) || !((GrabbableObject)this).playerHeldBy.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); SpawnPoolSource sourcePool = SourcePool; Quaternion rotation = ((Component)this).transform.rotation; List<KeyValuePair<GrabbableObject, int>> list = ItemSpawner.SpawnRandomItems(sourcePool, val3, val4, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f), CustomList, (Vector3[])null, amount, false, (RotationType)2); foreach (KeyValuePair<GrabbableObject, int> item in list) { item.Key.startFallingPosition = val3; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(item.Key)); item.Key.targetFloorPosition = item.Key.GetItemFloorPosition(((Component)this).transform.position); if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, item.Key); } ((NetworkBehaviour)item.Key).NetworkObject.Spawn(false); ItemSpawner.OverrideScrapValue(item.Key, item.Value); } } private IEnumerator SetObjectToHitGroundSFX(GrabbableObject gObject) { yield return (object)new WaitForEndOfFrame(); Debug.Log((object)("Setting " + gObject.itemProperties.itemName + " hit ground to false")); gObject.reachedFloorTarget = false; gObject.hasHitGround = false; gObject.fallTime = 0f; } [ClientRpc] private void OpenBoxClientRpc(int weightedEvent, int usesLeft) { //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_014f: 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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1016085238u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, weightedEvent); BytePacker.WriteValueBitPacked(val2, usesLeft); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1016085238u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } if ((Object)(object)PoofParticle != (Object)null) { PoofParticle.Play(); } if ((Object)(object)BoxAudio != (Object)null && (Object)(object)OpenBoxClip != (Object)null) { BoxAudio.PlayOneShot(OpenBoxClip); WalkieTalkie.TransmitOneShotAudio(BoxAudio, OpenBoxClip, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)BoxAudio).transform.position, 8f, 0.5f, 0, ((GrabbableObject)this).isInShipRoom && StartOfRound.Instance.hangarDoorsClosed, 0); } boxUses = usesLeft; OnBoxOpen(); InvokeRandomEvent(weightedEvent); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)OpenEvent).Invoke(((GrabbableObject)this).playerHeldBy); ((GrabbableObject)this).playerHeldBy.activatingItem = false; if (destroyWhenEmpty && boxUses <= 0) { ((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy); } } } private void InvokeRandomEvent(int weightedEvent) { if (weightedEvent >= 0 && weightedEvent < RandomOpenEvent.Length) { RandomOpenEvent[weightedEvent].Event.Invoke(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)RandomOpenEvent[weightedEvent].PlayerEvent).Invoke(((GrabbableObject)this).playerHeldBy); } } } public virtual void OnBoxOpen() { } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_JEventBoxItem() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1900567855u, new RpcReceiveHandler(__rpc_handler_1900567855)); NetworkManager.__rpc_func_table.Add(2647915572u, new RpcReceiveHandler(__rpc_handler_2647915572)); NetworkManager.__rpc_func_table.Add(1016085238u, new RpcReceiveHandler(__rpc_handler_1016085238)); } private static void __rpc_handler_1900567855(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; ((JEventBoxItem)(object)target).OpenGiftBoxServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2647915572(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; ((JEventBoxItem)(object)target).SpawnItemsServerRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1016085238(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 weightedEvent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref weightedEvent); int usesLeft = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref usesLeft); target.__rpc_exec_stage = (__RpcExecStage)2; ((JEventBoxItem)(object)target).OpenBoxClientRpc(weightedEvent, usesLeft); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JEventBoxItem"; } } public class JGrabbableObject : GrabbableObject { [Header("JGrabbableObject")] public GameObject chargedEffects; public GameObject[] hideWhenPocketed = (GameObject[])(object)new GameObject[0]; public UnityEvent OnEquip = new UnityEvent(); public InteractEvent OnEquipPlayer = new InteractEvent(); public UnityEvent OnPocketed = new UnityEvent(); public InteractEvent OnPocketedPlayer = new InteractEvent(); public BoolEvent OnSetInShip = new BoolEvent(); public UnityEvent OnPlacedOnDepositDesk = new UnityEvent(); public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if ((Object)(object)base.playerHeldBy != (Object)null && base.isHeld) { HeldUpdate(); } if (base.itemProperties.requiresBattery && base.insertedBattery != null) { GameObject obj = chargedEffects; if (obj != null) { obj.SetActive(!base.insertedBattery.empty); } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); GameObject[] array = hideWhenPocketed; foreach (GameObject val in array) { val.SetActive(true); } OnEquip.Invoke(); if ((Object)(object)base.playerHeldBy != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)OnEquipPlayer).Invoke(base.playerHeldBy); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); GameObject[] array = hideWhenPocketed; foreach (GameObject val in array) { val.SetActive(false); } OnPocketed.Invoke(); if ((Object)(object)base.playerHeldBy != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)OnPocketedPlayer).Invoke(base.playerHeldBy); } } public virtual void HeldUpdate() { } public virtual void OnSetInsideShip(bool isEntering) { } public virtual void PlacedOnDepositDesk() { } public bool IsBeingHeldByPlayer() { return (Object)(object)base.playerHeldBy != (Object)null && base.isHeld; } public void DamageHolder(int damage) { //IL_001a: 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 (IsBeingHeldByPlayer()) { base.playerHeldBy.DamagePlayer(damage, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } public void DestroyItemInHand() { if (IsBeingHeldByPlayer()) { ((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy); } } public void ForceDrop(bool dropAll) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (IsBeingHeldByPlayer()) { if (dropAll) { base.playerHeldBy.DropAllHeldItemsAndSync(); } else { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "JGrabbableObject"; } } public class JInteractableItem : JGrabbableObject { public enum InteractionType { Press, Toggle, Hold } [Header("Interactable Item")] public InteractionType interactionType = InteractionType.Press; public InteractEvent OnUse = new InteractEvent(); public BoolEvent OnToggle = new BoolEvent(); public UnityEvent OnHoldingButton = new UnityEvent(); [Header("Extra Events")] public InteractEvent CollisionEvent = new InteractEvent(); [Space(5f)] public AudioClip[] interactSFX = (AudioClip[])(object)new AudioClip[0]; public AudioClip[] disableSFX = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudio; public float maxVolume = 1f; public float minVolume = 0.8f; public Animator? triggerAnimator; private PlayerControllerB? playerLastHeld; private bool toggle = false; public override void EquipItem() { base.EquipItem(); playerLastHeld = ((GrabbableObject)this).playerHeldBy; } public override void ItemActivate(bool used, bool buttonDown = true) { if (used && (Object)(object)playerLastHeld != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)OnUse).Invoke(playerLastHeld); } switch (interactionType) { case InteractionType.Toggle: ToggleInteract(!toggle); break; case InteractionType.Hold: if (buttonDown) { OnHoldInteraction(); OnHoldingButton.Invoke(); } break; default: InteractFX(interactSFX, "interact"); break; } } public virtual void InteractFX(AudioClip[] clips, string trigger) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) Animator? obj = triggerAnimator; if (obj != null) { obj.SetTrigger(trigger); } if ((Object)(object)noiseAudio != (Object)null && Object.op_Implicit((Object)(object)noiseAudio) && clips.Length != 0) { int num = Random.Range(0, clips.Length); if ((Object)(object)clips[num] != (Object)null) { float num2 = Random.Range(minVolume, maxVolume); noiseAudio.PlayOneShot(clips[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)noiseAudio).transform.position, 4f * num2, num2 * 0.5f, 0, false, 0); } } } public void ToggleInteract() { ToggleInteract(!toggle); } public void ToggleInteract(bool on) { toggle = on; if (on) { InteractFX(interactSFX, "toggleOn"); } else { InteractFX(disableSFX, "toggleOff"); } ((GrabbableObject)this).isBeingUsed = on; OnToggled(on); ((UnityEvent<bool>)(object)OnToggle).Invoke(on); } public virtual void OnToggled(bool on) { } public virtual void OnHoldInteraction() { } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if ((Object)(object)playerLastHeld != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)CollisionEvent).Invoke(playerLastHeld); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "JInteractableItem"; } } public class JMeleeWeapon : JGrabbableObject { [Header("Melee Weapon")] public int HitForce = 1; [Tooltip("Shovel Default: 1.5\nKnife Default: 0.3")] public float weaponRange = 1.5f; [Tooltip("Shovel Default: 0.3\nKnife Default: 0.43")] public float weaponCooldown = 0.3f; [Tooltip("Leave blank for no blood particle on hit")] public ParticleSystem bloodParticle; private float timeAtLastDamageDealt; [Tooltip("Player is the player who swung the weapon")] public UnityEvent<PlayerControllerB> OnHitSuccess = new UnityEvent<PlayerControllerB>(); public LayerMask hitMask = LayerMask.op_Implicit(1084754248); [Tooltip("Default: 1\nPop Butlers: 5")] public int HitId = 1; [Header("Heavy Weapons")] [Tooltip("Heavy Weapons are similar to the shovel or signs.\nNon Heavy Weapons are similar to the Kitchen Knife")] public bool isHeavyWeapon = true; [Tooltip("Shovel Default: 0.35")] public float reelingTime = 0.35f; private float reelingAnimSpeed = 1f; [Tooltip("Shovel Default: 0.13")] public float swingTime = 0.13f; private bool reelingUp; private bool isHoldingButton; private Coroutine? reelingUpCoroutine; [Header("Damage Targets")] public bool damagePlayers = true; [Tooltip("Passes a Player that has been damaged by the weapon")] public UnityEvent<PlayerControllerB> OnPlayerHit = new UnityEvent<PlayerControllerB>(); public bool damageEnemies = true; [Tooltip("Passes an Enemy that has been damaged by the weapon")] public UnityEvent<EnemyAI> OnEnemyHit = new UnityEvent<EnemyAI>(); public bool damageVehicles = false; [Tooltip("Passes a Vehicle that has been damaged by the weapon")] public UnityEvent<VehicleController> OnVehicleHit = new UnityEvent<VehicleController>(); public bool damageObjects = true; [Tooltip("Passes an Object that has been damaged by the weapon")] public UnityEvent<IHittable> OnObjectHit = new UnityEvent<IHittable>(); [Header("Audio")] public AudioClip[] hitSFX; [Tooltip("Only used for Heavy Weapons")] public AudioClip[] reelUpSFX; public AudioClip[] swingSFX; public AudioSource weaponAudio; private PlayerControllerB previousPlayerHeldBy; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) { return; } previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (((GrabbableObject)this).itemProperties.requiresBattery && ((GrabbableObject)this).insertedBattery.empty) { return; } if (isHeavyWeapon) { isHoldingButton = buttonDown; if (!(!reelingUp && buttonDown)) { return; } reelingUp = true; previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (reelingUpCoroutine != null) { if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = 1f; } ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(ReelBackWeapon()); return; } PlayRandomSFX(swingSFX); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("UseHeldItem1"); } } if (((NetworkBehaviour)this).IsOwner && Time.realtimeSinceStartup - timeAtLastDamageDealt > weaponCooldown) { HitWeapon(); } } private IEnumerator ReelBackWeapon() { ((GrabbableObject)this).playerHeldBy.activatingItem = true; ((GrabbableObject)this).playerHeldBy.twoHanded = true; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { reelingAnimSpeed = 0.35f / reelingTime; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = reelingAnimSpeed; } PlayRandomSFX(reelUpSFX); ReelUpSFXServerRpc(); yield return (object)new WaitForSeconds(reelingTime); yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !((GrabbableObject)this).isHeld)); if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = 1f; } SwingHeavyWeapon(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(swingTime); yield return (object)new WaitForEndOfFrame(); HitWeapon(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(weaponCooldown); reelingUp = false; reelingUpCoroutine = null; } [ServerRpc] public void ReelUpSFXServerRpc() { //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_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)((NetworkBehaviour)this).__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(3259025159u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3259025159u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReelUpSFXClientRpc(); } } [ClientRpc] public void ReelUpSFXClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2764645124u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2764645124u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayRandomSFX(reelUpSFX); } } } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; if (JLLExtentions.IsLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.speed = 1f; } } ((GrabbableObject)this).DiscardItem(); } public virtual void SwingHeavyWeapon(bool cancel = false) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { PlayRandomSFX(swingSFX); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public bool HitWeapon(bool cancel = false) { //IL_0061: 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_0080: 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_00a6: 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_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030b: 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_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Expected I4, but got Unknown if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called."); return false; } previousPlayerHeldBy.activatingItem = false; int num = -1; bool flag = false; bool flag2 = false; if (!cancel) { previousPlayerHeldBy.twoHanded = false; RaycastHit[] source = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, weaponRange / 1.5f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, weaponRange, LayerMask.op_Implicit(hitMask), (QueryTriggerInteraction)2); List<RaycastHit> list = source.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); List<GameObject> list2 = new List<GameObject>(); Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; IHittable val = default(IHittable); VehicleController val8 = default(VehicleController); foreach (RaycastHit item in list) { RaycastHit current = item; if (((Component)((RaycastHit)(ref current)).collider).gameObject.layer == 8 || ((Component)((RaycastHit)(ref current)).collider).gameObject.layer == 11) { if (((RaycastHit)(ref current)).collider.isTrigger) { continue; } for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (((Component)((RaycastHit)(ref current)).collider).gameObject.tag == StartOfRound.Instance.footstepSurfaces[i].surfaceTag) { num = i; flag = true; break; } } continue; } if (((Component)((RaycastHit)(ref current)).collider).TryGetComponent<IHittable>(ref val)) { GameObject val2 = null; ColliderType val3 = (ColliderType)3; bool flag3 = true; EnemyAICollisionDetect val4 = (EnemyAICollisionDetect)(object)((val is EnemyAICollisionDetect) ? val : null); if (val4 != null) { flag3 = damageEnemies; val2 = ((Component)val4.mainScript).gameObject; val3 = (ColliderType)1; } else { PlayerControllerB val5 = (PlayerControllerB)(object)((val is PlayerControllerB) ? val : null); if (val5 != null) { if (val5.actualClientId == previousPlayerHeldBy.actualClientId) { continue; } flag3 = damagePlayers; val2 = ((Component)val5).gameObject; val3 = (ColliderType)0; } else { flag3 = damageObjects; val2 = ((Component)((RaycastHit)(ref current)).collider).gameObject; } } JLogHelper.LogInfo($"{((Object)((RaycastHit)(ref current)).transform).name} {flag3}", (JLogLevel)2); if (flag3 && (Object)(object)val2 != (Object)null && !list2.Contains(val2) && OnWeaponHit(val, forward)) { list2.Add(val2); if (!flag) { flag = true; } if (!flag2) { flag2 = true; } ColliderType val6 = val3; ColliderType val7 = val6; switch ((int)val7) { case 0: { OnPlayerHit.Invoke(((Component)((RaycastHit)(ref current)).collider).GetComponent<PlayerControllerB>()); ParticleSystem obj2 = bloodParticle; if (obj2 != null) { obj2.Play(true); } break; } case 1: { OnEnemyHit.Invoke(((Component)((RaycastHit)(ref current)).collider).GetComponent<EnemyAICollisionDetect>().mainScript); ParticleSystem obj = bloodParticle; if (obj != null) { obj.Play(true); } break; } case 3: OnObjectHit.Invoke(val); break; } } } if (damageVehicles && ((Component)((RaycastHit)(ref current)).collider).TryGetComponent<VehicleController>(ref val8) && !list2.Contains(((Component)val8).gameObject)) { list2.Add(((Component)val8).gameObject); flag = true; val8.PushTruckServerRpc(((Component)previousPlayerHeldBy).transform.position, forward); VehicleControllerPatch.DealPermanentDamage((object)val8, HitForce, ((Component)previousPlayerHeldBy).transform.position); OnVehicleHit.Invoke(val8); } } } if (flag) { timeAtLastDamageDealt = Time.realtimeSinceStartup; PlayRandomSFX(hitSFX); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { weaponAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(weaponAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } if (isHeavyWeapon) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); } HitWeaponServerRpc(num); } return flag; } public virtual bool OnWeaponHit(IHittable target, Vector3 hitDir) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) return target.Hit(HitForce, hitDir, previousPlayerHeldBy, true, HitId); } [ServerRpc] public void HitWeaponServerRpc(int hitSurfaceID) { //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_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)((NetworkBehaviour)this).__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(1250179881u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1250179881u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { HitWeaponClientRpc(hitSurfaceID); } } [ClientRpc] public void HitWeaponClientRpc(int hitSurfaceID) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(209898509u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 209898509u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayRandomSFX(hitSFX); OnHitSuccess.Invoke(previousPlayerHeldBy); if (hitSurfaceID != -1) { HitSurface(hitSurfaceID); } } } private void PlayRandomSFX(AudioClip[] clips) { if (clips.Length > 1) { RoundManager.PlayRandomClip(weaponAudio, clips, true, 1f, 0, 1000); } else if (clips.Length == 1) { weaponAudio.PlayOneShot(clips[0], Random.Range(0.82f, 1f)); } } private void HitSurface(int hitSurfaceID) { weaponAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(weaponAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_JMeleeWeapon() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3259025159u, new RpcReceiveHandler(__rpc_handler_3259025159)); NetworkManager.__rpc_func_table.Add(2764645124u, new RpcReceiveHandler(__rpc_handler_2764645124)); NetworkManager.__rpc_func_table.Add(1250179881u, new RpcReceiveHandler(__rpc_handler_1250179881)); NetworkManager.__rpc_func_table.Add(209898509u, new RpcReceiveHandler(__rpc_handler_209898509)); } private static void __rpc_handler_3259025159(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; ((JMeleeWeapon)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2764645124(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)2; ((JMeleeWeapon)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1250179881(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((JMeleeWeapon)(object)target).HitWeaponServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_209898509(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)2; ((JMeleeWeapon)(object)target).HitWeaponClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JMeleeWeapon"; } } public class JNoisemakerProp : JGrabbableObject { [Header("Noisemaker")] public bool isToggle = false; public bool waitForCompletion = false; private float activeClipLength = 0f; private float lastUsedTime = 0f; [Space(5f)] public AudioClip[] noiseSFX = (AudioClip[])(object)new AudioClip[0]; public AudioClip[] disableSFX = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudio; public AudioClip[] noiseSFXFar = (AudioClip[])(object)new AudioClip[0]; public AudioSource noiseAudioFar; [Space(3f)] [Tooltip("Airhorn: 65\nCash Register: 25\nClown Horn: 60\nHair Dryer: 30")] public float noiseRange = 60f; [Tooltip("Airhorn: 1\nCash Register: 1\nClown Horn: 1\nHair Dryer: 0.9")] public float maxLoudness = 1f; [Tooltip("Airhorn: 0.95\nCash Register: 0.9\nClown Horn: 0.6\nHair Dryer: 0.8")] public float minLoudness = 0.6f; [Tooltip("Airhorn: 1\nCash Register: 1\nClown Horn: 1\nHair Dryer: 1")] public float maxPitch = 1f; [Tooltip("Airhorn: 0.8\nCash Register: 0.95\nClown Horn: 0.93\nHair Dryer: 0.96")] public float minPitch = 0.93f; private Random noisemakerRandom; public Animator? triggerAnimator; public override void Start() { ((GrabbableObject)this).Start(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_029b: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (Time.realtimeSinceStartup - lastUsedTime < activeClipLength) { if (isToggle) { if ((Object)(object)noiseAudio != (Object)null) { noiseAudio.Stop(); if (disableSFX.Length != 0) { int num = noisemakerRandom.Next(0, disableSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(disableSFX[num], num2); } } AudioSource obj = noiseAudioFar; if (obj != null) { obj.Stop(); } activeClipLength = 0f; return; } if (waitForCompletion) { return; } } if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { int num3 = noisemakerRandom.Next(0, noiseSFX.Length); float num4 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch2 = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; activeClipLength = noiseSFX[num3].length; lastUsedTime = Time.realtimeSinceStartup; if ((Object)(object)noiseAudio != (Object)null) { noiseAudio.pitch = pitch2; noiseAudio.PlayOneShot(noiseSFX[num3], num4); } if ((Object)(object)noiseAudioFar != (Object)null && num3 < noiseSFXFar.Length) { noiseAudioFar.pitch = pitch2; noiseAudioFar.PlayOneShot(noiseSFXFar[num3], num4); } Animator? obj2 = triggerAnimator; if (obj2 != null) { obj2.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num3], num4); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num4, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); if (minLoudness >= 0.6f && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.timeSinceMakingLoudNoise = 0f; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "JNoisemakerProp"; } } public class JThrowableItem : JGrabbableObject { [Header("Throwable Item")] public bool throwable = true; public string throwString = "Throw grenade: [RMB]"; private LayerMask projectileMask = LayerMask.op_Implicit(268437761); public AnimationCurve projectileFallCurve; public AnimationCurve projectileVerticalFallCurve; public AnimationCurve projectileVerticalFallCurveNoBounce; [Header("Explosion Settings")] public bool damageOnExplode = false; public bool stunOnExplode = false; public bool spawnItemsOnExplode = false; public GameObject? explosionPrefab; public bool hasExploded = false; [Tooltip("Random chance is rolled on impact. If interaction is required then explosion chance will only be rolled on collisions after the interaction has been performed")] public float chanceToExplodeOnThrow = 100f; [Tooltip("Random chance is rolled on impact. If interaction is required then explosion chance will only be rolled on collisions after the interaction has been performed")] public float chanceToExplodeOnDropped = 100f; public bool destroyOnExplode = false; [Header("Interact Before Throw")] public bool hasInteraction = false; public string interactString = "Pull pin: [RMB]"; public string playerAnimation = "PullGrenadePin"; public bool interactedWith = false; private bool inInteractAnimation = false; private Coroutine? interactCoroutine; public bool interactionStartsTimer = false; [Tooltip("Waits timeToExplode before exploding. If interactionStartsTimer is checked the timer will have to run twice for the explosion to occur.")] [FormerlySerializedAs("explodeOnTimer")] public bool explosionStartsTimer = false; private bool markedToExplode = false; public float timeToExplode = 2.25f; private float explodeTimer = 0f; [Header("Explosion Properties")] public float killDistance = 0.5f; public float damageRange = 3f; public int nonLethalDamage = 40; public float pushForce = 45f; public bool goThroughCar = false; [Header("Stun Explosion Properties")] public bool affectAudio = true; public float flashSeverityMultiplier = 1f; public float enemyStunTime = 7.5f; public float flashSeverityDistanceRolloff = 1f; [Header("Item Spawner")] [Tooltip("How many items get spawned in")] public int numberToSpawn = 1; public SpawnPoolSource SourcePool = (SpawnPoolSource)0; public WeightedItemRefrence[] CustomList = (WeightedItemRefrence[])(object)new WeightedItemRefrence[1] { new WeightedItemRefrence() }; [Tooltip("Spawn offsets. Index is the number spawned")] public Vector3[] SpawnOffsets = (Vector3[])(object)new Vector3[0]; [Header("Events")] public UnityEvent ExplodeEvent = new UnityEvent(); public InteractEvent ThrowEvent = new InteractEvent(); public InteractEvent InteractionEvent = new InteractEvent(); public InteractEvent CollisionEvent = new InteractEvent(); [Header("FX")] [Tooltip("Trigger: \"pullPin\"\nTrigger: \"explode\"")] public Animator? itemAnimator; public AudioSource itemAudio; public AudioClip? interactSFX; public AudioClip? explodeSFX; private bool explodeOnThrow = false; private bool explodeOnDrop = false; private bool wasThrown = false; private PlayerControllerB? playerThrownBy; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (inInteractAnimation) { return; } if (hasInteraction && !interactedWith) { if (interactCoroutine == null) { ((GrabbableObject)this).playerHeldBy.activatingItem = true; interactCoroutine = ((MonoBehaviour)this).StartCoroutine(interactAnimation()); } } else if (((NetworkBehaviour)this).IsOwner && throwable) { ThrowItem(); } } public virtual void ThrowItem() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) wasThrown = true; ((UnityEvent<PlayerControllerB>)(object)ThrowEvent).Invoke(((GrabbableObject)this).playerHeldBy); ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetThrowDestination(), true); } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { base.EquipItem(); playerThrownBy = ((GrabbableObject)this).playerHeldBy; explodeOnThrow = false; explodeOnDrop = false; wasThrown = false; SetExplodeOnThrowServerRpc(); } [ServerRpc(RequireOwnership = false)] public void SetExplodeOnThrowServerRpc() { //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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4058280918u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4058280918u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetExplodeOnThrowClientRpc(new Random(StartOfRound.Instance.randomMapSeed + 10 + (int)((Component)this).transform.position.x + (int)((Component)this).transform.position.z).Next(0, 100)); } } } [ClientRpc] public void SetExplodeOnThrowClientRpc(int random) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(217367956u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, random); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 217367956u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { explodeOnThrow = (float)random <= chanceToExplodeOnThrow; explodeOnDrop = (float)random <= chanceToExplodeOnDropped; } } } public override void SetControlTipsForItem() { List<string> list = new List<string>(); list.AddRange(((GrabbableObject)this).itemProperties.toolTips); if (hasInteraction && !interactedWith) { list.Add(interactString); } else if (throwable) { list.Add(throwString); } HUDManager.Instance.ChangeControlTipMultiple(list.ToArray(), true, ((GrabbableObject)this).itemProperties); } public override void FallWithCurve() { //IL_0002: 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_0027: 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_005c: 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) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_00de: 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_010e: 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_012e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, projectileFallCurve.Evaluate(((GrabbableObject)this).fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), projectileVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), projectileVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } private IEnumerator interactAnimation() { inInteractAnimation = true; ((GrabbableObject)this).playerHeldBy.activatingItem = true; ((GrabbableObject)this).playerHeldBy.doingUpperBodyEmote = 1.16f; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger(playerAnimation); Animator? obj = itemAnimator; if (obj != null) { obj.SetTrigger("pullPin"); } if (Object.op_Implicit((Object)(object)itemAudio) && (Object)(object)interactSFX != (Object)null) { itemAudio.PlayOneShot(interactSFX); WalkieTalkie.TransmitOneShotAudio(itemAudio, interactSFX, 0.8f); } ((UnityEvent<PlayerControllerB>)(object)InteractionEvent).Invoke(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1f); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { if (!destroyOnExplode) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; } playerThrownBy = ((GrabbableObject)this).playerHeldBy; } inInteractAnimation = false; interactedWith = true; ((GrabbableObject)this).itemUsedUp = true; if (((NetworkBehaviour)this).IsOwner && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).SetControlTipsForItem(); } } public override void Update() { ((GrabbableObject)this).Update(); if (((!interactionStartsTimer || !interactedWith) && (!explosionStartsTimer || !markedToExplode)) || hasExploded) { return; } explodeTimer += Time.deltaTime; if (explodeTimer > timeToExplode) { if (interactionStartsTimer && explosionStartsTimer && !markedToExplode) { markedToExplode = true; explodeTimer = 0f; } else { ExplodeProjectile(destroyOnExplode); } } } public override void Start() { ((GrabbableObject)this).Start(); if (!hasInteraction) { interactedWith = true; } } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if ((Object)(object)playerThrownBy != (Object)null && (!hasInteraction || interactedWith)) { ((UnityEvent<PlayerControllerB>)(object)CollisionEvent).Invoke(playerThrownBy); OnItemCollision(wasThrown); } } public virtual void OnItemCollision(bool thrown) { if ((thrown && explodeOnThrow) || (!thrown && explodeOnDrop)) { ExplodeProjectile(destroyOnExplode); } } public void ExplodeProjectile(bool destroy = false) { if (hasExploded) { return; } if (!StartOfRound.Instance.currentLevel.spawnEnemiesAndScrap && (Object)(object)((GrabbableObject)this).parentObject == (Object)(object)Object.FindObjectOfType<DepositItemsDesk>().deskObjectsContainer) { if ((Object)(object)playerThrownBy != (Object)null) { playerThrownBy.activatingItem = false; } return; } Animator? obj = itemAnimator; if (obj != null) { obj.SetTrigger("explode"); } if (explosionStartsTimer && !markedToExplode) { markedToExplode = true; return; } hasExploded = true; ExplodeEvent.Invoke(); Transform parent = ((!((GrabbableObject)this).isInElevator) ? RoundManager.Instance.mapPropsContainer.transform : StartOfRound.Instance.elevatorTransform); CreateExplosion(parent); if (destroy) { ((GrabbableObject)this).DestroyObjectInHand(playerThrownBy); } } public virtual void CreateExplosion(Transform parent) { //IL_0012: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (damageOnExplode) { Landmine.SpawnExplosion(((Component)this).transform.position, false, killDistance, damageRange, nonLethalDamage, pushForce, (GameObject)null, goThroughCar); } if (stunOnExplode) { StunGrenadeItem.StunExplosion(((Component)this).transform.position, affectAudio, flashSeverityMultiplier, enemyStunTime, flashSeverityDistanceRolloff, ((GrabbableObject)this).isHeld, ((GrabbableObject)this).playerHeldBy, playerThrownBy, 0f); } if (spawnItemsOnExplode) { SpawnItemsOnServer(numberToSpawn); } if ((Object)(object)explosionPrefab != (Object)null) { Object.Instantiate<GameObject>(explosionPrefab, ((Component)this).transform.position, Quaternion.identity, parent); } if (Object.op_Implicit((Object)(object)itemAudio) && (Object)(object)explodeSFX != (Object)null) { itemAudio.PlayOneShot(explodeSFX); WalkieTalkie.TransmitOneShotAudio(itemAudio, explodeSFX, 1f); } } public void ResetExplosionTimer() { explodeTimer = 0f; } public void SpawnItemsOnServer(int amount) { //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_0016: 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) //IL_0020: 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_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_0060: 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) Vector3 val = ((Component)this).transform.position + Vector3.up * 0.25f; Transform val2 = ((!((GrabbableObject)this).isInElevator) ? RoundManager.Instance.mapPropsContainer.transform : StartOfRound.Instance.elevatorTransform); SpawnPoolSource sourcePool = SourcePool; Quaternion rotation = ((Component)this).transform.rotation; ItemSpawner.SpawnRandomItems(sourcePool, val, val2, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f), CustomList, SpawnOffsets, amount, true, (RotationType)2); } public Vector3 GetThrowDestination() { //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_001d: 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_0059: 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) //IL_0078: 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_00b0: 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_00b5: 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_00b7: 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_00ce: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Debug.DrawRay(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f); Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); position = ((!Physics.Raycast(val, ref val2, 12f, LayerMask.op_Implicit(projectileMask), (QueryTriggerInteraction)1)) ? ((Ray)(ref val)).GetPoint(10f) : ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val2)).distance - 0.05f)); Debug.DrawRay(position, Vector3.down, Color.blue, 15f); ((Ray)(ref val))..ctor(position, Vector3.down); if (Physics.Raycast(val, ref val2, 30f, LayerMask.op_Implicit(projectileMask), (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val2)).point + Vector3.up * 0.05f; } return ((Ray)(ref val)).GetPoint(30f); } private void OnDrawGizmosSelected() { //IL_001e: 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_0053: 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) if (damageOnExplode) { 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); } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_JThrowableItem() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(4058280918u, new RpcReceiveHandler(__rpc_handler_4058280918)); NetworkManager.__rpc_func_table.Add(217367956u, new RpcReceiveHandler(__rpc_handler_217367956)); } private static void __rpc_handler_4058280918(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; ((JThrowableItem)(object)target).SetExplodeOnThrowServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_217367956(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 explodeOnThrowClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref explodeOnThrowClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((JThrowableItem)(object)target).SetExplodeOnThrowClientRpc(explodeOnThrowClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JThrowableItem"; } } } namespace JLLItemsModule.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }
BepInEx/plugins/JLL/WesleyMoonScripts.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using DisplayAllMoons; using DunGen; using GameNetcodeStuff; using HarmonyLib; using JLL; using JLL.API; using JLL.API.Compatability; using JLL.API.LevelProperties; using JLL.Components; using JLL.ScriptableObjects; using JLLItemsModule.Components; using LethalLevelLoader; using Microsoft.CodeAnalysis; using MoonUnlockUnhide; using MrovLib; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Video; using WesleyMoonScripts.Components; using WesleyMoonScripts.NetcodePatcher; using WesleyMoonScripts.Patches; using WesleyMoonScripts.Patches.ReLocker; using WesleyMoonScripts.ScriptableObjects; [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: IgnoresAccessChecksTo("MoonUnlockUnhide")] [assembly: AssemblyCompany("WesleyMoonScripts")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("WesleyMoonScripts")] [assembly: AssemblyTitle("WesleyMoonScripts")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace WesleyMoonScripts { [BepInPlugin("JacobG5.WesleyMoonScripts", "WesleyMoonScripts", "1.1.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [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 WesleyScripts : BaseUnityPlugin { private const string modGUID = "JacobG5.WesleyMoonScripts"; private const string modName = "WesleyMoonScripts"; private const string modVersion = "1.1.2"; public static WesleyScripts Instance; internal ManualLogSource mls; public static ConfigEntry<bool> LockMoons; private readonly Harmony harmony = new Harmony("JacobG5.WesleyMoonScripts"); internal static bool WesleyPresent; public void Awake() { Instance = this; mls = Logger.CreateLogSource("JacobG5.WesleyMoonScripts"); JLL.NetcodePatch(mls, Assembly.GetExecutingAssembly().GetTypes()); WesleyPresent = JCompatabilityHelper.IsLoaded((CachedMods)16); if (WesleyPresent) { LockMoons = ((BaseUnityPlugin)this).Config.Bind<bool>("Core", "LockMoons", true, "Locks moons that have progression integration set up to enable playing the campaign."); if (LockMoons.Value) { if (JCompatabilityHelper.IsLoaded("ProjectBots.MoonUnlockUnhide", StringComparison.InvariantCultureIgnoreCase)) { mls.LogInfo((object)"Patching MoonUnlockUnhide"); try { harmony.PatchAll(typeof(MoonUnlockUnhidePatch)); } catch (Exception arg) { mls.LogWarning((object)$"Patching MoonUnlockUnhide Failed!\n{arg}"); } } if (JCompatabilityHelper.IsLoaded("DisplayAllMoons", StringComparison.InvariantCultureIgnoreCase)) { mls.LogInfo((object)"Patching DisplayAllMoons"); try { harmony.PatchAll(typeof(DisplayAllMoonsPatch)); } catch (Exception arg2) { mls.LogWarning((object)$"Patching DisplayAllMoons Failed!\n{arg2}"); } } } } try { harmony.PatchAll(typeof(LLLContentPatch)); } catch (Exception arg3) { mls.LogWarning((object)$"Patching LLL PatchedContent Failed!\n{arg3}"); } harmony.PatchAll(typeof(EntranceTeleportPatch)); } public static bool ProtectionEnabled() { return WesleyPresent && LockMoons.Value; } } } namespace WesleyMoonScripts.ScriptableObjects { [CreateAssetMenu(menuName = "JLL/WesleyMoons/ProgressionIntegration", order = 20)] public class WesleyProgressionIntegration : JLLAddon { [Serializable] public class WesleyIntegratedLevel { public string sceneName; public string planetName; public bool forceLock = true; public bool moonUnlockerProtection = true; [HideInInspector] public string NumberlessName => new string(planetName.SkipWhile((char c) => !char.IsLetter(c)).ToArray()); } public static List<WesleyIntegratedLevel> AllLevels = new List<WesleyIntegratedLevel>(); public WesleyIntegratedLevel[] IntegratedLevels = new WesleyIntegratedLevel[1] { new WesleyIntegratedLevel() }; public override void Init(JLLMod parent) { AllLevels.AddRange(IntegratedLevels); if (!WesleyScripts.WesleyPresent || !WesleyScripts.LockMoons.Value) { return; } List<WesleyIntegratedLevel> source = IntegratedLevels.Where((WesleyIntegratedLevel x) => x.forceLock).ToList(); if (JCompatabilityHelper.IsLoaded((CachedMods)17)) { LMUHelper.SubscribeStoryLocks(source.Select((WesleyIntegratedLevel x) => x.NumberlessName).ToArray()); } } } } namespace WesleyMoonScripts.Patches { [HarmonyPatch(typeof(EntranceTeleport))] internal class EntranceTeleportPatch { [HarmonyPatch("TeleportPlayerClientRpc")] [HarmonyPostfix] public static void patchTeleportPlayerClient(AudioSource ___exitPointAudio) { ExitDoorEffects exitDoorEffects = default(ExitDoorEffects); if ((Object)(object)___exitPointAudio != (Object)null && ((Component)___exitPointAudio).TryGetComponent<ExitDoorEffects>(ref exitDoorEffects)) { exitDoorEffects.PlayExitFX(); } } } internal class LLLContentPatch { [HarmonyPatch(typeof(PatchedContent), "PopulateContentDictionaries")] [HarmonyPostfix] private static void PopulateContentPatch() { if (!WesleyScripts.ProtectionEnabled()) { return; } foreach (WesleyProgressionIntegration.WesleyIntegratedLevel allLevel in WesleyProgressionIntegration.AllLevels) { ExtendedLevel level = LLLHelper.GetLevel(allLevel.sceneName); if ((Object)(object)level != (Object)null && allLevel.forceLock) { level.IsRouteLocked = true; level.IsRouteHidden = true; } } } } } namespace WesleyMoonScripts.Patches.ReLocker { [HarmonyPatch] internal class DisplayAllMoonsPatch { private static MethodBase TargetMethod() { return AccessTools.Method(typeof(ConfigManager), "Init", (Type[])null, (Type[])null); } private static void Postfix() { List<string> list = new List<string>(); list.AddRange(from x in ((ConfigHandler<SelectableLevel[], string>)(object)ConfigManager.BlacklistList).ConfigEntry.Value.Split(';') where !Utility.IsNullOrWhiteSpace(x) select x); foreach (WesleyProgressionIntegration.WesleyIntegratedLevel allLevel in WesleyProgressionIntegration.AllLevels) { string numberlessName = allLevel.NumberlessName; if (allLevel.moonUnlockerProtection && !list.Contains(numberlessName)) { list.Add(numberlessName); } } ((ConfigHandler<SelectableLevel[], string>)(object)ConfigManager.BlacklistList).ConfigEntry.Value = string.Join(';', list) + ";"; } } [HarmonyPatch] public class MoonUnlockUnhidePatch { private static MethodBase TargetMethod() { return AccessTools.Method(typeof(UnlockUnhidePatch), "genIgnoreMoonsList", (Type[])null, (Type[])null); } private static void Postfix() { try { WesleyScripts.Instance.mls.LogInfo((object)$"Adding {WesleyProgressionIntegration.AllLevels.Count} ingore levels."); foreach (WesleyProgressionIntegration.WesleyIntegratedLevel allLevel in WesleyProgressionIntegration.AllLevels) { if (allLevel.moonUnlockerProtection) { string text = allLevel.NumberlessName.ToLower(); UnlockUnhidePatch.ignoreMoons.Add(text); WesleyScripts.Instance.mls.LogInfo((object)("Ignoring " + text)); } } } catch (Exception arg) { WesleyScripts.Instance.mls.LogWarning((object)$"Caught Error patching MoonUnlockUnhide: {arg}"); } } } } namespace WesleyMoonScripts.Components { public class Clock : MonoBehaviour { public enum TimeScale { GameTime, RealTime, Random, Disabled } public Transform hourHand; public Transform minuteHand; public TimeScale timeScale = TimeScale.GameTime; public bool smoothTicks = false; public Vector2 randomScaleRange = new Vector2(0f, 1.5f); [Header("Complying with wesly's demands")] public AudioClip[] tick = (AudioClip[])(object)new AudioClip[0]; private int clip = 0; public AudioSource audioSource; private float lastMinute = 0f; private float randomCurrent; private float randomScale; public void Start() { randomCurrent = Random.Range(0f, 1440f); randomScale = Random.Range(randomScaleRange.x, randomScaleRange.y); } public void Update() { switch (timeScale) { case TimeScale.GameTime: { int num = (int)(TimeOfDay.Instance.normalizedTimeOfDay * (60f * (float)TimeOfDay.Instance.numberOfHours)) + 360; UpdateHandRots(num / 60, num); break; } case TimeScale.RealTime: { DateTime now = DateTime.Now; UpdateHandRots((float)now.Hour + (float)now.Minute / 60f, (float)now.Minute + (float)now.Second / 60f); break; } case TimeScale.Random: randomCurrent += Time.deltaTime * randomScale; UpdateHandRots(randomCurrent / 60f, randomCurrent); break; } } public void UpdateHandRots(float hours, float minutes) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Floor(minutes); if (lastMinute != num) { lastMinute = num; if ((Object)(object)audioSource != (Object)null && tick.Length != 0) { audioSource.PlayOneShot(tick[clip]); clip++; if (clip >= tick.Length) { clip = 0; } } } if (!smoothTicks) { minutes = num; } hourHand.localEulerAngles = new Vector3(0f, 360f * (hours / 12f), 0f); minuteHand.localEulerAngles = new Vector3(0f, 360f * (minutes / 60f), 0f); } public void SetRandomTimeScale(float timeScale) { randomScale = timeScale; } } public class ExitDoorEffects : MonoBehaviour { public EntranceTeleport entranceDoor; public ParticleSystem exitParticles; public AudioClip exitSound; public AudioSource audioSource; public void PlayExitFX() { exitParticles.Play(); audioSource.PlayOneShot(exitSound); } } [RequireComponent(typeof(LocalVolumetricFog))] public class FadingFogVolume : MonoBehaviour, IDungeonLoadListener { public Vector2 ActiveDistanceMinMax = new Vector2(5f, 10f); public Vector2 ActiveDurationMinMax = new Vector2(8f, 16f); public Vector2 InActiveDistanceMinMax = new Vector2(15f, 25f); public Vector2 InActiveDurationMinMax = new Vector2(4f, 12f); public Vector2 transitionDurationMinMax = new Vector2(0.5f, 4f); private bool activePhase = false; public bool transitioning = false; private float timer = 0f; private float timerStart = 0f; private float targetDensity; private LocalVolumetricFog volumetricFog; private Random Random; private bool initialized = false; public int relativeSeed = 21; [Header("SFX")] public AudioSource source; public AudioClip fadeIn; public AudioClip fadeOut; public void PostDungeonGeneration() { volumetricFog = ((Component)this).GetComponent<LocalVolumetricFog>(); Random = new Random(StartOfRound.Instance.randomMapSeed + relativeSeed); initialized = (Object)(object)volumetricFog != (Object)null; } public void Update() { //IL_0110: 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_0076: 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) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { return; } timer -= Time.deltaTime; if (transitioning) { if (timer < 0f) { transitioning = false; volumetricFog.parameters.meanFreePath = targetDensity; timer = (timerStart = RandomBetween(activePhase ? ActiveDurationMinMax : InActiveDurationMinMax)); } else { volumetricFog.parameters.meanFreePath = Mathf.Lerp(targetDensity, volumetricFog.parameters.meanFreePath, timer / timerStart); } } else if (timer < 0f) { transitioning = true; activePhase = !activePhase; targetDensity = RandomBetween(activePhase ? ActiveDistanceMinMax : InActiveDistanceMinMax); timer = (timerStart = RandomBetween(transitionDurationMinMax)); AudioClip val = (activePhase ? fadeIn : fadeOut); if ((Object)(object)source != (Object)null && (Object)(object)val != (Object)null) { source.PlayOneShot(val); } } } private float RandomBetween(Vector2 minMax) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Mathf.Lerp(minMax.x, minMax.y, (float)Random.NextDouble()); } } [RequireComponent(typeof(Doorway))] public class GrandArmoryBlocker : MonoBehaviour, IDungeonLoadListener { private Doorway doorway; public List<GameObjectWeight> BlockerPrefabWeights = new List<GameObjectWeight>(); private void Start() { doorway = ((Component)this).GetComponent<Doorway>(); } public void PostDungeonGeneration() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)doorway.ConnectedDoorway == (Object)null) { Object.Instantiate<GameObject>(DungeonUtil.GetRandom(BlockerPrefabWeights, RoundManager.Instance.dungeonGenerator.Generator.RandomStream), ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } } public class HorrorEvent : NetworkBehaviour { [Serializable] public class WeightedHorrorEvent : IWeightedItem { public string AnimationTrigger = ""; public UnityEvent Event = new UnityEvent(); [Range(0f, 100f)] public int Weight = 20; public int GetWeight() { return Weight; } } [Header("Chances")] [Range(0f, 100f)] public float StandardChance = 2f; [Range(0f, 100f)] public float MeltdownChance = 20f; [Header("Validation")] public float MaxPlayerDistance = 15f; public float MinPlayerDistance = 0f; public bool RequireLineOfSight = false; public LayerMask RaycastMask = LayerMask.op_Implicit(1084754248); public float RollInterval = 25f; private float RollTimer = 0f; public int repeatLimit = 0; private bool finished = false; public float cooldown = 60f; [Header("EventTrigger")] public Animator? animator; public WeightedHorrorEvent[] horrorEvents = new WeightedHorrorEvent[0]; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (cooldown < 0f) { cooldown = 0f - cooldown; } RollTimer = Random.Range(0f - cooldown, 0f); } public void Update() { //IL_0086: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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) if ((!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost) || finished) { return; } RollTimer += Time.deltaTime; if (!(RollTimer > RollInterval)) { return; } RollTimer -= RollInterval; bool flag = false; GameObject[] allPlayerObjects = RoundManager.Instance.playersManager.allPlayerObjects; RaycastHit val2 = default(RaycastHit); foreach (GameObject val in allPlayerObjects) { float num = Vector3.Distance(((Component)this).transform.position, val.transform.position); if (num < MaxPlayerDistance && num >= MinPlayerDistance && (!RequireLineOfSight || !Physics.Raycast(((Component)this).transform.position, val.transform.position, ref val2, MaxPlayerDistance, LayerMask.op_Implicit(RaycastMask)) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 3)) { flag = true; break; } } if (flag && (float)Random.Range(0, 100) < (JLevelPropertyRegistry.ApparatusPulled ? MeltdownChance : StandardChance)) { TriggerHorrorEventServerRpc(); } } [ServerRpc] private void TriggerHorrorEventServerRpc() { //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_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(1348150288u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1348150288u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && horrorEvents.Length != 0) { IWeightedItem[] array = (IWeightedItem[])(object)horrorEvents; TriggerHorrorEventClientRpc(IWeightedItem.GetRandomIndex(array)); } } [ClientRpc] private void TriggerHorrorEventClientRpc(int index) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2586387981u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2586387981u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && horrorEvents.Length != 0 && index >= 0 && index < horrorEvents.Length) { WeightedHorrorEvent weightedHorrorEvent = horrorEvents[index]; if ((Object)(object)animator != (Object)null && !string.IsNullOrEmpty(weightedHorrorEvent.AnimationTrigger)) { animator.ResetTrigger(weightedHorrorEvent.AnimationTrigger); animator.SetTrigger(weightedHorrorEvent.AnimationTrigger); } weightedHorrorEvent.Event.Invoke(); repeatLimit--; if (repeatLimit < 0) { finished = true; } else { RollTimer = 0f - cooldown; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_HorrorEvent() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1348150288u, new RpcReceiveHandler(__rpc_handler_1348150288)); NetworkManager.__rpc_func_table.Add(2586387981u, new RpcReceiveHandler(__rpc_handler_2586387981)); } private static void __rpc_handler_1348150288(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; ((HorrorEvent)(object)target).TriggerHorrorEventServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2586387981(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)2; ((HorrorEvent)(object)target).TriggerHorrorEventClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HorrorEvent"; } } public class ItemShop : NetworkBehaviour { [Serializable] public class SaleSpot { public float emptyChance = 0.2f; public Transform transform; public InteractTrigger buyInteract; [HideInInspector] public int price; [HideInInspector] public GrabbableObject? item = null; [HideInInspector] public bool ready = false; } public bool spawnOnStart = true; public float priceMultiplier = 1.2f; public bool setScrapValue = false; public string purchasedString = "Purchased!"; public string emptyString = "Empty"; public SaleSpot[] spawnPositions = new SaleSpot[1] { new SaleSpot() }; public WeightedItemRefrence[] Catalogue = (WeightedItemRefrence[])(object)new WeightedItemRefrence[1] { new WeightedItemRefrence() }; public AudioSource audioSource; public AudioClip buyClip; public float syncDelay = 2f; public override void OnNetworkSpawn() { //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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) ((NetworkBehaviour)this).OnNetworkSpawn(); SaleSpot[] array = spawnPositions; foreach (SaleSpot saleSpot in array) { saleSpot.buyInteract.interactable = false; saleSpot.buyInteract.disabledHoverTip = emptyString; } if (!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost) { return; } WeightedItemRefrence[] catalogue = Catalogue; foreach (WeightedItemRefrence val in catalogue) { val.FindRegistered(); } SaleSpot[] array2 = spawnPositions; int num = default(int); Vector3 val2 = default(Vector3); foreach (SaleSpot saleSpot2 in array2) { if ((Object)(object)saleSpot2.transform == (Object)null || (Object)(object)saleSpot2.buyInteract == (Object)null || Random.Range(0f, 1f) < saleSpot2.emptyChance) { continue; } Item randomItem = ItemSpawner.GetRandomItem((SpawnPoolSource)0, ref num, ref val2, Catalogue); if ((Object)(object)randomItem != (Object)null && (Object)(object)randomItem.spawnPrefab != (Object)null) { GrabbableObject val3 = ItemSpawner.SpawnItem(randomItem, saleSpot2.transform.position + val2, saleSpot2.transform, saleSpot2.transform.rotation, -1, false, (RotationType)2); if ((Object)(object)val3 != (Object)null) { saleSpot2.price = ((num < 0) ? Mathf.RoundToInt((float)Random.Range(val3.itemProperties.minValue, val3.itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier) : num); saleSpot2.item = val3; ((NetworkBehaviour)val3).NetworkObject.Spawn(false); } } } ((MonoBehaviour)this).StartCoroutine(SyncItems()); } private IEnumerator SyncItems() { yield return (object)new WaitForSeconds(syncDelay); for (int i = 0; i < spawnPositions.Length; i++) { SaleSpot itemSpawn = spawnPositions[i]; if ((Object)(object)itemSpawn.item != (Object)null) { ItemSpawner.OverrideScrapValue(itemSpawn.item, setScrapValue ? itemSpawn.price : 0); itemSpawn.price = Mathf.RoundToInt((float)itemSpawn.price * priceMultiplier); SyncBuyableClientRpc(i, itemSpawn.price, NetworkObjectReference.op_Implicit(((NetworkBehaviour)itemSpawn.item).NetworkObject)); itemSpawn.ready = true; } } } [ClientRpc] private void SyncBuyableClientRpc(int index, int price, NetworkObjectReference itemRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00b1: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1254916123u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); BytePacker.WriteValueBitPacked(val2, price); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref itemRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1254916123u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } int index2 = index; if (index2 < 0 || index2 >= spawnPositions.Length) { return; } SaleSpot saleSpot = spawnPositions[index2]; NetworkObject val3 = default(NetworkObject); GrabbableObject val4 = default(GrabbableObject); if (((NetworkObjectReference)(ref itemRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent<GrabbableObject>(ref val4)) { val4.grabbable = (val4.grabbableToEnemies = false); saleSpot.price = price; saleSpot.item = val4; saleSpot.buyInteract.interactable = true; saleSpot.buyInteract.hoverTip = $"{val4.itemProperties.itemName} : {price}"; ((UnityEvent<PlayerControllerB>)(object)saleSpot.buyInteract.onInteract).AddListener((UnityAction<PlayerControllerB>)delegate(PlayerControllerB player) { AttemptPurchaseServerRpc(index2, JLLExtentions.Index(player)); }); } } public void AttemptPurchase(int slot) { AttemptPurchaseServerRpc(slot); } [ServerRpc(RequireOwnership = false)] private void AttemptPurchaseServerRpc(int slot, int client = -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_0144: 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(2558224897u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, client); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2558224897u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || slot < 0 || slot >= spawnPositions.Length) { return; } SaleSpot saleSpot = spawnPositions[slot]; if (saleSpot.ready && !((Object)(object)saleSpot.item == (Object)null)) { if (JLevelPropertyRegistry.GetTerminal().groupCredits >= saleSpot.price) { PurchaseClientRpc(slot, saleSpot.price, NetworkObjectReference.op_Implicit(((NetworkBehaviour)saleSpot.item).NetworkObject)); } else { FailPurchaseClientRpc(client); } } } [ClientRpc] private void PurchaseClientRpc(int slot, int price, NetworkObjectReference itemRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00b1: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2489186323u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, price); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref itemRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2489186323u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Terminal terminal = JLevelPropertyRegistry.GetTerminal(); terminal.groupCredits -= price; NetworkObject val3 = default(NetworkObject); GrabbableObject val4 = default(GrabbableObject); if (((NetworkObjectReference)(ref itemRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent<GrabbableObject>(ref val4)) { val4.grabbable = (val4.grabbableToEnemies = true); InteractTrigger buyInteract = spawnPositions[slot].buyInteract; buyInteract.interactable = false; buyInteract.disabledHoverTip = purchasedString; } if ((Object)(object)audioSource != (Object)null && (Object)(object)buyClip != (Object)null) { audioSource.PlayOneShot(buyClip); } } } [ClientRpc] private void FailPurchaseClientRpc(int clientId) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2869992630u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2869992630u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && JLLExtentions.Index(StartOfRound.Instance.localPlayerController) == clientId) { JHudHelper.QueueDisplayTip("Error", "Not enough credits to purchase this item.", true, false, "LC_Tip1"); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ItemShop() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1254916123u, new RpcReceiveHandler(__rpc_handler_1254916123)); NetworkManager.__rpc_func_table.Add(2558224897u, new RpcReceiveHandler(__rpc_handler_2558224897)); NetworkManager.__rpc_func_table.Add(2489186323u, new RpcReceiveHandler(__rpc_handler_2489186323)); NetworkManager.__rpc_func_table.Add(2869992630u, new RpcReceiveHandler(__rpc_handler_2869992630)); } private static void __rpc_handler_1254916123(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_005e: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref itemRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((ItemShop)(object)target).SyncBuyableClientRpc(index, price, itemRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2558224897(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 slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); int client = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref client); target.__rpc_exec_stage = (__RpcExecStage)1; ((ItemShop)(object)target).AttemptPurchaseServerRpc(slot, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2489186323(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_005e: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref itemRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((ItemShop)(object)target).PurchaseClientRpc(slot, price, itemRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2869992630(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 clientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)2; ((ItemShop)(object)target).FailPurchaseClientRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ItemShop"; } } public class LevelCassetteItem : MonoBehaviour { [Header("Cassette Loader")] public bool DestroyAfterUse = false; public string LoaderName = "Galetry"; public VideoClip Video; public AudioSource AudioLog; [Header("Cassette Data")] public string LevelSceneName = ""; public bool unlockLevel = true; public UnityEvent OnCollect = new UnityEvent(); public bool GetExtendedLevel(out ExtendedLevel extendedLevel) { extendedLevel = ((IEnumerable<ExtendedLevel>)PatchedContent.ExtendedLevels).FirstOrDefault((Func<ExtendedLevel, bool>)((ExtendedLevel x) => x.SelectableLevel.sceneName == LevelSceneName)); if ((Object)(object)extendedLevel == (Object)null) { extendedLevel = PatchedContent.ExtendedLevels[0]; return false; } return true; } } public class LevelCassetteLoader : NetworkBehaviour { [Serializable] public class TapeFinishedEvent { public string clipName; public InteractEvent FinishedEvent = new InteractEvent(); } [Header("Cassette Loader")] public string LoaderName = "Galetry"; public VideoPlayer screenPlayer; public VideoClip awakeClip; public AudioSource audioPlayer; public Animator animator; public InteractEvent OnTapeLoaded = new InteractEvent(); public float tapeEndOffset = -2f; public bool isTapePlaying = false; public float tapeLength = 0f; private string unlockedLevelName = string.Empty; private PlayerControllerB lastPlayerUsed; public InteractEvent OnTapeFinished = new InteractEvent(); public TapeFinishedEvent[] TapeFinishedEvents = new TapeFinishedEvent[0]; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (Object.op_Implicit((Object)(object)screenPlayer)) { if ((Object)(object)awakeClip != (Object)null) { screenPlayer.clip = awakeClip; screenPlayer.Play(); } if (Object.op_Implicit((Object)(object)audioPlayer)) { screenPlayer.audioOutputMode = (VideoAudioOutputMode)1; screenPlayer.EnableAudioTrack((ushort)0, true); screenPlayer.SetTargetAudioSource((ushort)0, audioPlayer); screenPlayer.controlledAudioTrackCount = 1; } } } public void StartLoadingCassette(PlayerControllerB player) { LoadCassetteServerRpc(JLLExtentions.Index(player)); } [ServerRpc(RequireOwnership = false)] private void LoadCassetteServerRpc(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) 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(2088416495u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2088416495u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { LoadCassetteClientRpc(playerWhoSent); } } } [ClientRpc] private void LoadCassetteClientRpc(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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1055522164u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1055522164u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; if ((Object)(object)val3.currentlyHeldObjectServer == (Object)null) { return; } bool flag = false; LevelCassetteItem[] components = ((Component)val3.currentlyHeldObjectServer).GetComponents<LevelCassetteItem>(); foreach (LevelCassetteItem levelCassetteItem in components) { if (levelCassetteItem.LoaderName == LoaderName) { lastPlayerUsed = val3; LoadCassette(levelCassetteItem); ((UnityEvent<PlayerControllerB>)(object)OnTapeLoaded).Invoke(lastPlayerUsed); if (levelCassetteItem.DestroyAfterUse) { flag = true; } } } if (flag) { val3.DestroyItemInSlot(val3.currentItemSlot); } } public void LoadCassette(LevelCassetteItem cassette) { TapeEnded(); isTapePlaying = true; Animator obj = animator; if (obj != null) { obj.SetBool("playing", true); } if (Object.op_Implicit((Object)(object)screenPlayer) && (Object)(object)cassette.Video != (Object)null) { WesleyScripts.Instance.mls.LogInfo((object)"Attempting to play video."); screenPlayer.Stop(); screenPlayer.clip = cassette.Video; screenPlayer.Play(); tapeLength = (float)cassette.Video.length + tapeEndOffset; } AudioSource audioLog = cassette.AudioLog; if (audioLog != null) { audioLog.Play(); } cassette.OnCollect.Invoke(); if (cassette.GetExtendedLevel(out ExtendedLevel extendedLevel)) { unlockedLevelName = extendedLevel.SelectableLevel.PlanetName; WesleyScripts.Instance.mls.LogInfo((object)$"Unlocking {unlockedLevelName} | Tape Length: {tapeLength}"); if (JCompatabilityHelper.IsLoaded((CachedMods)17)) { LMUHelper.ReleaseLock(extendedLevel.NumberlessPlanetName); return; } extendedLevel.IsRouteLocked = !cassette.unlockLevel; extendedLevel.IsRouteHidden = !cassette.unlockLevel; } } private void Update() { if (isTapePlaying) { tapeLength -= Time.deltaTime; if (tapeLength <= 0f) { TapeEnded(); } } } private void TapeEnded() { isTapePlaying = false; Animator obj = animator; if (obj != null) { obj.SetBool("playing", false); } tapeLength = 0f; if (unlockedLevelName != string.Empty) { JHudHelper.QueueDisplayTip("Route Discovered!", "Location: " + unlockedLevelName, false, false, "LC_Tip1"); unlockedLevelName = string.Empty; } ((UnityEvent<PlayerControllerB>)(object)OnTapeFinished).Invoke(lastPlayerUsed); if ((Object)(object)awakeClip != (Object)null) { screenPlayer.clip = awakeClip; screenPlayer.Play(); } if (TapeFinishedEvents == null || !((Object)(object)screenPlayer != (Object)null) || !((Object)(object)screenPlayer.clip != (Object)null)) { return; } TapeFinishedEvent[] tapeFinishedEvents = TapeFinishedEvents; foreach (TapeFinishedEvent tapeFinishedEvent in tapeFinishedEvents) { if (tapeFinishedEvent.clipName == ((Object)screenPlayer.clip).name) { ((UnityEvent<PlayerControllerB>)(object)tapeFinishedEvent.FinishedEvent).Invoke(lastPlayerUsed); break; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_LevelCassetteLoader() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2088416495u, new RpcReceiveHandler(__rpc_handler_2088416495)); NetworkManager.__rpc_func_table.Add(1055522164u, new RpcReceiveHandler(__rpc_handler_1055522164)); } private static void __rpc_handler_2088416495(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; ((LevelCassetteLoader)(object)target).LoadCassetteServerRpc(playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1055522164(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)2; ((LevelCassetteLoader)(object)target).LoadCassetteClientRpc(playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "LevelCassetteLoader"; } } public class LoneTrap : MonoBehaviour { public float range = 12f; public bool rotate = true; public float rotSpeed = 1f; [Header("Target is Close")] public float closeRange = 4f; public float closeEventCooldown = 2f; private float closeTimer = 0f; public InteractEvent CloseEvent = new InteractEvent(); private PlayerControllerB? target; public void FixedUpdate() { //IL_00a7: 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_0032: 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_0114: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < range && val.isPlayerAlone && !val.isPlayerDead) { target = val; break; } } } else if (!target.isPlayerAlone || target.isPlayerDead || Vector3.Distance(((Component)target).transform.position, ((Component)this).transform.position) > range) { target = null; closeTimer = 0f; return; } if (!((Object)(object)target != (Object)null)) { return; } if (rotate) { Transform transform = ((Component)this).transform; Quaternion rotation = ((Component)this).transform.rotation; Vector3 val2 = ((Component)target).transform.position - ((Component)this).transform.position; Quaternion val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); transform.rotation = Quaternion.Slerp(rotation, Quaternion.Euler(0f, ((Quaternion)(ref val3)).eulerAngles.y, 0f), Time.deltaTime * rotSpeed); } if (closeTimer <= 0f) { closeTimer = closeRange; if (Vector3.Distance(((Component)target).transform.position, ((Component)this).transform.position) < closeRange) { ((UnityEvent<PlayerControllerB>)(object)CloseEvent).Invoke(target); } } else { closeTimer -= Time.deltaTime; } } public void OnDrawGizmos() { //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) if (range > 0f) { Gizmos.color = Color.white; Gizmos.DrawWireSphere(((Component)this).transform.position, range); } if (closeRange > 0f) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, closeRange); } } } public class MicBombItem : JGrabbableObject { [Header("Mic Bomb Item")] public bool isBombActive = true; public bool hasExploded = false; public bool destroyOnExplode = true; public UnityEvent ExplodeEvent = new UnityEvent(); public float minLoudness = 0.25f; public float coolOffRate = 1f; public float maxAgression = 16f; private float currentAgression = 0f; [Header("Beep Sounds")] public float beepRate = 2f; private float beepTimer = 0f; public AudioClip[] audioClips = (AudioClip[])(object)new AudioClip[0]; public float minVolume = 0.8f; public float maxVolume = 1f; public float minPitch = 0.85f; public float maxPitch = 1.2f; public AudioSource audioSource; public override void Update() { ((GrabbableObject)this).Update(); if (isBombActive && !hasExploded && currentAgression > 0f) { if (currentAgression > maxAgression) { TriggerExplosionServerRpc(); } beepTimer -= Time.deltaTime; if (beepTimer < 0f) { PlayBeepAudio(); beepTimer = beepRate / Mathf.Max(1f, currentAgression); } currentAgression -= Time.deltaTime * coolOffRate; currentAgression = Mathf.Max(0f, currentAgression); } } private void PlayBeepAudio() { if ((Object)(object)audioSource != (Object)null && audioClips.Length != 0) { audioSource.pitch = Random.Range(minPitch, maxPitch); audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)], Random.Range(minVolume, maxVolume)); } } [ServerRpc(RequireOwnership = false)] private void TriggerExplosionServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3583080074u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3583080074u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { TriggerExplosionClientRpc(); } } } [ClientRpc] private void TriggerExplosionClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(521066593u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 521066593u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !hasExploded) { hasExploded = true; ExplodeEvent.Invoke(); if (destroyOnExplode) { ((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy); } } } public override void OnSetInsideShip(bool isInside) { ((JGrabbableObject)this).OnSetInsideShip(isInside); if (isInside) { isBombActive = false; } } public void IncreaseAgression() { currentAgression += 1f; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); isBombActive = (saveData & 1) != 0; hasExploded = (saveData & 2) != 0; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); int num = 0; if (isBombActive) { num |= 1; } if (hasExploded) { num |= 2; } return num; } protected override void __initializeVariables() { ((JGrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_MicBombItem() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3583080074u, new RpcReceiveHandler(__rpc_handler_3583080074)); NetworkManager.__rpc_func_table.Add(521066593u, new RpcReceiveHandler(__rpc_handler_521066593)); } private static void __rpc_handler_3583080074(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; ((MicBombItem)(object)target).TriggerExplosionServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_521066593(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)2; ((MicBombItem)(object)target).TriggerExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MicBombItem"; } } public class MicBombMicrophone : MonoBehaviour, INoiseListener { public MicBombItem micBombItem; public void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //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) if (Physics.Linecast(((Component)this).transform.position, noisePosition, 256)) { noiseLoudness /= 2f; } if (!(noiseLoudness < micBombItem.minLoudness)) { micBombItem.IncreaseAgression(); } } } public class Mortor : NetworkBehaviour { public enum MortorRange { Surface, MortorProximity } private class Shell { public GameObject obj; public float destroyTimer = 0f; public float airTime = 0f; public Vector3 targetPos = Vector3.zero; public bool inAir { get; private set; } = true; public Vector3 CalcPos(Vector3 origin, AnimationCurve arc, float progress) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //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_000f: 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_0023: 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_002e: 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) Vector3 val = Vector3.Lerp(origin, targetPos, progress); return new Vector3(val.x, val.y + arc.Evaluate(progress), val.z); } public void Explode(float killRange, float damageRange, int nonLethalDamage, float pushForce, GameObject prefab) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //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) Landmine.SpawnExplosion(targetPos + Vector3.up, true, killRange, damageRange, nonLethalDamage, pushForce, prefab, true); inAir = false; MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val in componentsInChildren) { ((Renderer)val).enabled = false; } } } public AnimationCurve arc; public float projAirTime = 5f; [Range(0f, 100f)] public float targetPlayerChance = 60f; [Header("Firing")] public int shellCount = 4; private int firedShells = 0; private int playerShell = -1; private bool isFiring = false; public float shellSeperation = 0.5f; private float timeSinceLastShell = 0f; public float timeBetweenFires = 20f; private float cooldownTimer = 0f; [Header("Prefabs")] public GameObject ProjectilePrefab; public float destroyAfter = 5f; public GameObject ExplosionPrefab; public float killDistance = 8f; public float damageRange = 18f; public int nonLethalDMG = 50; public float pushForce = 60f; [Header("Targetting Region")] public bool drawDebug = true; public MortorRange targetRange = MortorRange.Surface; public float proximityDistance = 35f; public bool fireOnLoop = true; public AnimationCurve fireLoopCooldown; private float fireCooldown = 0f; private List<Shell> launchedProjectiles = new List<Shell>(); private bool networkSpawned = false; [Header("FX")] public ParticleSystem shootParticle; public AudioSource nearSource; public AudioClip nearClip; public AudioSource farSource; public AudioClip farClip; public Vector2 pitchMinMax = new Vector2(1f, 1f); [HideInInspector] public bool OnCooldown => cooldownTimer > 0f; private void OnEnable() { cooldownTimer = timeBetweenFires * Random.Range(0.8f, 1.35f); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); networkSpawned = true; } private void Update() { //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) if (!networkSpawned) { return; } if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { if (OnCooldown) { cooldownTimer -= Time.deltaTime; } else if (isFiring) { timeSinceLastShell += Time.deltaTime; if (timeSinceLastShell > shellSeperation) { FireShellServerRpc(); timeSinceLastShell = 0f; firedShells++; } if (firedShells >= shellCount) { isFiring = false; firedShells = 0; cooldownTimer = timeBetweenFires; if (fireOnLoop) { fireCooldown = fireLoopCooldown.Evaluate(TimeOfDay.Instance.normalizedTimeOfDay); } } } else if (fireOnLoop) { if (fireCooldown < 0f) { FireShellSequence(); } else { fireCooldown -= Time.deltaTime; } } } foreach (Shell item in new List<Shell>(launchedProjectiles)) { if (item.inAir) { item.airTime += Time.deltaTime; if (item.airTime > projAirTime) { item.Explode(killDistance, damageRange, nonLethalDMG, pushForce, ExplosionPrefab); continue; } item.obj.transform.position = item.CalcPos(((Component)this).transform.position, arc, item.airTime / projAirTime); item.obj.transform.LookAt(item.CalcPos(((Component)this).transform.position, arc, (item.airTime + 0.01f) / projAirTime)); } else { item.destroyTimer -= Time.deltaTime; if (item.destroyTimer < 0f) { Object.Destroy((Object)(object)item.obj); launchedProjectiles.Remove(item); } } } } public void EnableLooping() { ToggleLoopFireServerRpc(enabled: true); } public void DisableFire() { ToggleLoopFireServerRpc(enabled: false); } public void ToggleLoop(bool toggle) { ToggleLoopFireServerRpc(toggle); } [ServerRpc(RequireOwnership = false)] private void ToggleLoopFireServerRpc(bool enabled) { //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) 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(2063045087u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enabled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2063045087u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ToggleLoopFireClientRpc(enabled); } } } [ClientRpc] private void ToggleLoopFireClientRpc(bool enabled) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2165139199u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enabled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2165139199u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { fireOnLoop = enabled; if (enabled) { FireShellSequence(); return; } isFiring = false; cooldownTimer = timeBetweenFires; } } public void FireShellSequence(bool respectCooldown = true) { FireShellSequence(targetPlayerChance, respectCooldown); } public void FireShellSequence(float playerChance, bool respectCooldown = true) { if (!respectCooldown || !OnCooldown) { firedShells = 0; timeSinceLastShell = 0f; cooldownTimer = 0f; isFiring = true; playerShell = ((Random.Range(0f, 100f) < playerChance) ? Random.Range(0, firedShells) : (-1)); } } [ServerRpc] private void FireShellServerRpc() { //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_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 //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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)) { 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(434675724u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 434675724u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } List<Vector3> list = new List<Vector3>(); if (firedShells == playerShell) { MortorRange mortorRange = targetRange; MortorRange mortorRange2 = mortorRange; if (mortorRange2 == MortorRange.MortorProximity) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; NavMeshHit val4 = default(NavMeshHit); foreach (PlayerControllerB val3 in allPlayerScripts) { if (!val3.isPlayerDead && Vector3.Distance(((Component)val3).transform.position, ((Component)this).transform.position) < proximityDistance && NavMesh.SamplePosition(((Component)val3).transform.position, ref val4, 15f, 655)) { list.Add(((NavMeshHit)(ref val4)).position); } } } else { PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; NavMeshHit val6 = default(NavMeshHit); foreach (PlayerControllerB val5 in allPlayerScripts2) { if (!val5.isPlayerDead && !val5.isInsideFactory && !val5.isInElevator && NavMesh.SamplePosition(((Component)val5).transform.position, ref val6, 15f, 655)) { list.Add(((NavMeshHit)(ref val6)).position); } } } } if (list.Count == 0) { Vector3 result; switch (targetRange) { case MortorRange.Surface: { GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes; foreach (GameObject val7 in outsideAINodes) { if (RandomNavPos(val7.transform.position, proximityDistance, out result)) { list.Add(result); } } break; } case MortorRange.MortorProximity: if (RandomNavPos(((Component)this).transform.position, proximityDistance, out result)) { list.Add(result); } break; } } if (list.Count > 0) { FireShellClientRpc(list[Random.Range(0, list.Count)]); } } [ClientRpc] private void FireShellClientRpc(Vector3 targetPos) { //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_00ca: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1721816884u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1721816884u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { FireShellLocal(targetPos); } } } private void FireShellLocal(Vector3 targetPos) { //IL_00ea: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) float pitch = ((pitchMinMax.x >= pitchMinMax.y) ? pitchMinMax.y : Random.Range(pitchMinMax.x, pitchMinMax.y)); if ((Object)(object)nearSource != (Object)null && (Object)(object)nearClip != (Object)null) { nearSource.pitch = pitch; nearSource.PlayOneShot(nearClip); } if ((Object)(object)farSource != (Object)null && (Object)(object)farClip != (Object)null) { farSource.pitch = pitch; farSource.PlayOneShot(farClip); } ParticleSystem obj = shootParticle; if (obj != null) { obj.Play(); } Shell shell = new Shell { obj = Object.Instantiate<GameObject>(ProjectilePrefab, ((Component)this).transform.position, Quaternion.identity), destroyTimer = destroyAfter, airTime = 0f, targetPos = targetPos }; launchedProjectiles.Add(shell); ((Component)this).transform.LookAt(shell.CalcPos(((Component)this).transform.position, arc, 0.01f)); } public bool RandomNavPos(Vector3 pos, float radius, out Vector3 result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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_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_0014: 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_003e: 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_002f: Unknown result type (might be due to invalid IL or missing references) pos = Random.insideUnitSphere * radius + pos; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(pos, ref val, radius, 655)) { result = ((NavMeshHit)(ref val)).position; return true; } result = Vector3.zero; return false; } private void OnDrawGizmos() { //IL_005c: 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) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!drawDebug) { return; } switch (targetRange) { case MortorRange.Surface: { GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode"); foreach (GameObject val in array) { if (proximityDistance > 0f) { Gizmos.color = Color.black; Gizmos.DrawWireSphere(val.transform.position, proximityDistance); } if (killDistance > 0f) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(val.transform.position, killDistance); } if (damageRange > 0f) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(val.transform.position, damageRange); } } break; } case MortorRange.MortorProximity: if (proximityDistance > 0f) { Gizmos.color = Color.black; Gizmos.DrawWireSphere(((Component)this).transform.position, proximityDistance); } 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); } break; } } public void OnDisable() { foreach (Shell launchedProjectile in launchedProjectiles) { Object.Destroy((Object)(object)launchedProjectile.obj); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Mortor() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2063045087u, new RpcReceiveHandler(__rpc_handler_2063045087)); NetworkManager.__rpc_func_table.Add(2165139199u, new RpcReceiveHandler(__rpc_handler_2165139199)); NetworkManager.__rpc_func_table.Add(434675724u, new RpcReceiveHandler(__rpc_handler_434675724)); NetworkManager.__rpc_func_table.Add(1721816884u, new RpcReceiveHandler(__rpc_handler_1721816884)); } private static void __rpc_handler_2063045087(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 enabled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enabled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Mortor)(object)target).ToggleLoopFireServerRpc(enabled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2165139199(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 enabled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enabled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((Mortor)(object)target).ToggleLoopFireClientRpc(enabled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_434675724(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; ((Mortor)(object)target).FireShellServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1721816884(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) { Vector3 targetPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPos); target.__rpc_exec_stage = (__RpcExecStage)2; ((Mortor)(object)target).FireShellClientRpc(targetPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Mortor"; } } public class MortorSensor : MonoBehaviour { public Mortor mortor; public bool respectCooldown = true; [Range(0f, 100f)] public float triggerChance = 20f; private void OnTriggerEnter(Collider other) { PlayerControllerB val = default(PlayerControllerB); if ((((NetworkBehaviour)mortor).IsHost || ((NetworkBehaviour)mortor).IsServer) && Random.Range(0f, 100f) < triggerChance && ((Component)other).gameObject.TryGetComponent<PlayerControllerB>(ref val)) { mortor.FireShellSequence(100f, respectCooldown); } } } public class ProggressionObject : MonoBehaviour { public bool destroy = true; private void Start() { if (!WesleyScripts.ProtectionEnabled()) { if (destroy) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { ((Component)this).gameObject.SetActive(false); } } } } public class StoneRaycast : MonoBehaviour { public float Range = 5f; public bool ActiveBeam = true; public LayerMask mask = LayerMask.op_Implicit(1084754248); public Material Replacement; private void FixedUpdate() { if (ActiveBeam) { KillCast(); } } public void KillCast() { //IL_0007: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); PlayerControllerB val2 = default(PlayerControllerB); if (!Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.TransformDirection(Vector3.forward), ref val, Range, LayerMask.op_Implicit(mask)) || !((Component)((RaycastHit)(ref val)).collider).gameObject.CompareTag("Player") || !((Component)((RaycastHit)(ref val)).collider).gameObject.TryGetComponent<PlayerControllerB>(ref val2)) { return; } try { Transform val3 = Object.Instantiate<Transform>(((Component)val2).transform.Find("ScavengerModel")); ((Component)val3).transform.position = ((Component)val2).transform.position; ((Component)val3).transform.rotation = ((Component)val2).transform.rotation; LODGroup val4 = default(LODGroup); if (((Component)val3).TryGetComponent<LODGroup>(ref val4)) { WesleyScripts.Instance.mls.LogInfo((object)val4.GetLODs()[0].renderers.Count()); } Transform val5 = val3.Find("metarig"); ((Renderer)val2.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)1; RigBuilder val6 = default(RigBuilder); if (((Component)val5).TryGetComponent<RigBuilder>(ref val6)) { Object.Destroy((Object)(object)val6); } PlayerAnimationEvents val7 = default(PlayerAnimationEvents); if (((Component)val5).TryGetComponent<PlayerAnimationEvents>(ref val7)) { Object.Destroy((Object)(object)val7); } PlayAudioAnimationEvent val8 = default(PlayAudioAnimationEvent); if (((Component)val5).TryGetComponent<PlayAudioAnimationEvent>(ref val8)) { Object.Destroy((Object)(object)val8); } Animator val9 = default(Animator); if (((Component)val5).TryGetComponent<Animator>(ref val9)) { Object.Destroy((Object)(object)val9); } BoxCollider val10 = ((Component)val3).gameObject.AddComponent<BoxCollider>(); val10.center = new Vector3(0f, 1.2f, 0f); val10.size = new Vector3(0.75f, 2.3f, 0.4f); Rigidbody val11 = ((Component)val3).gameObject.AddComponent<Rigidbody>(); val11.drag = 5f; val11.angularDrag = 12f; SkinnedMeshRenderer val12 = default(SkinnedMeshRenderer); for (int i = 0; i < val3.childCount; i++) { if (((Component)val3.GetChild(i)).TryGetComponent<SkinnedMeshRenderer>(ref val12)) { ((Renderer)val12).materials = (Material[])(object)new Material[1] { Replacement }; ((Renderer)val12).allowOcclusionWhenDynamic = false; } } Object.Destroy((Object)(object)((Component)val5.Find("ScavengerModelArmsOnly")).gameObject); Object.Destroy((Object)(object)((Component)val5.Find("CameraContainer")).gameObject); } catch (Exception arg) { WesleyScripts.Instance.mls.LogWarning((object)$"Something went wrong destroying parts of the Player Rig!\n{arg}"); } val2.KillPlayer(Vector3.zero, false, (CauseOfDeath)5, 0, default(Vector3)); } 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_002f: 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_003f: 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) if (Range > 0f) { Gizmos.color = Color.red; Gizmos.DrawLine(((Component)this).transform.position, ((Component)this).transform.TransformDirection(Vector3.forward * Range) + ((Component)this).transform.position); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace WesleyMoonScripts.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }