Decompiled source of Chocobo Getaway Scrap v1.0.0
plugins/ImmersiveScrap.dll
Decompiled 4 days 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 GameNetcodeStuff; using ImmersiveScrap.Configs; using ImmersiveScrap.Keybinds; using ImmersiveScrap.Misc; using ImmersiveScrap.NetcodePatcher; using LethalCompanyInputUtils.Api; using LethalLevelLoader; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ImmersiveScrap")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Immersive Scrap mod with 40+ Vanilla style Scrap!")] [assembly: AssemblyFileVersion("1.4.1.0")] [assembly: AssemblyInformationalVersion("1.4.1+423798bcc22618cfc1f7fa83f7357cbf3e6b55ee")] [assembly: AssemblyProduct("ImmersiveScrap")] [assembly: AssemblyTitle("ImmersiveScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ImmersiveScrap { [BepInPlugin("ImmersiveScrap", "ImmersiveScrap", "1.4.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static GameObject explosionPrefab; internal static IngameKeybinds InputActionsInstance; public static ImmersiveScrapConfig ModConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; InputActionsInstance = new IngameKeybinds(); ModConfig = new ImmersiveScrapConfig(((BaseUnityPlugin)this).Config); AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)OnExtendedModRegistered, "XuXiaolan", "ImmersiveScraps"); AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)OnLethalBundleLoaded, "immersivescrapassets.lethalbundle"); InitializeNetworkBehaviours(); Logger.LogInfo((object)"Plugin ImmersiveScrap is loaded!"); } internal static void OnExtendedModRegistered(ExtendedMod extendedMod) { if ((Object)(object)extendedMod == (Object)null) { return; } foreach (ExtendedItem extendedItem in extendedMod.ExtendedItems) { string configValueForItem = GetConfigValueForItem(extendedItem.Item.itemName); if (!string.IsNullOrEmpty(configValueForItem)) { List<StringWithRarity> collection = ConfigParsing(configValueForItem); extendedItem.LevelMatchingProperties.levelTags.AddRange(collection); extendedItem.LevelMatchingProperties.planetNames.AddRange(collection); Logger.LogInfo((object)$"Updated matching properties for {extendedItem.Item}."); } } } internal static void OnLethalBundleLoaded(AssetBundle assetBundle) { _ = (Object)(object)assetBundle == (Object)null; } private static string GetConfigValueForItem(string itemName) { switch (itemName) { case "Alcohol Flask": return ImmersiveScrapConfig.ConfigAlcoholSpawnWeight.Value; case "ImmersiveAnvil": return ImmersiveScrapConfig.ConfigAnvilSpawnWeight.Value; case "IBaseball bat": return ImmersiveScrapConfig.ConfigBaseballSpawnWeight.Value; case "Beer can": return ImmersiveScrapConfig.ConfigBeercanSpawnWeight.Value; case "IBrick": return ImmersiveScrapConfig.ConfigBrickSpawnWeight.Value; case "Broken engine": return ImmersiveScrapConfig.ConfigBrokenEngineSpawnWeight.Value; case "Bucket": return ImmersiveScrapConfig.ConfigBucketSpawnWeight.Value; case "Can paint": return ImmersiveScrapConfig.ConfigCanPaintSpawnWeight.Value; case "Canteen": return ImmersiveScrapConfig.ConfigCanteenSpawnWeight.Value; case "Car battery": return ImmersiveScrapConfig.ConfigCarBatterySpawnWeight.Value; case "Clamp": return ImmersiveScrapConfig.ConfigClampSpawnWeight.Value; case "IClock": return ImmersiveScrapConfig.ConfigClockSpawnWeight.Value; case "IFan": return ImmersiveScrapConfig.ConfigFanSpawnWeight.Value; case "Fancy Painting": return ImmersiveScrapConfig.ConfigFancyPaintingSpawnWeight.Value; case "IFireAxe": return ImmersiveScrapConfig.ConfigFireAxeSpawnWeight.Value; case "Fire extinguisher": return ImmersiveScrapConfig.ConfigFireExtingSpawnWeight.Value; case "Fire hydrant": return ImmersiveScrapConfig.ConfigFireHydrantSpawnWeight.Value; case "Food can": return ImmersiveScrapConfig.ConfigFoodCanSpawnWeight.Value; case "Gameboy": return ImmersiveScrapConfig.ConfigGameboySpawnWeight.Value; case "Garbage": return ImmersiveScrapConfig.ConfigGarbageSpawnWeight.Value; case "ImmersiveHammer": return ImmersiveScrapConfig.ConfigHammerSpawnWeight.Value; case "Jerrycan": return ImmersiveScrapConfig.ConfigJerryCanSpawnWeight.Value; case "IKeyboard": return ImmersiveScrapConfig.ConfigKeyboardSpawnWeight.Value; case "ILantern": return ImmersiveScrapConfig.ConfigLanternSpawnWeight.Value; case "Library lamp": return ImmersiveScrapConfig.ConfigLibraryLampSpawnWeight.Value; case "ImmersivePlant": return ImmersiveScrapConfig.ConfigPlantSpawnWeight.Value; case "Pliers": return ImmersiveScrapConfig.ConfigPliersSpawnWeight.Value; case "Plunger": return ImmersiveScrapConfig.ConfigPlungerSpawnWeight.Value; case "Retro Toy": return ImmersiveScrapConfig.ConfigRetroToySpawnWeight.Value; case "Screwdriver": return ImmersiveScrapConfig.ConfigScrewdriverSpawnWeight.Value; case "Sink": return ImmersiveScrapConfig.ConfigSinkSpawnWeight.Value; case "Socket Wrench": return ImmersiveScrapConfig.ConfigSocketSpawnWeight.Value; case "ISqueaky toy": return ImmersiveScrapConfig.ConfigSqueakyToySpawnWeight.Value; case "Suitcase": return ImmersiveScrapConfig.ConfigSuitcaseSpawnWeight.Value; case "Toaster": return ImmersiveScrapConfig.ConfigToasterSpawnWeight.Value; case "IToolbox": return ImmersiveScrapConfig.ConfigToolboxSpawnWeight.Value; case "Top hat": return ImmersiveScrapConfig.ConfigTophatSpawnWeight.Value; case "Traffic cone": return ImmersiveScrapConfig.ConfigTrafficConeSpawnWeight.Value; case "Vent": return ImmersiveScrapConfig.ConfigVentSpawnWeight.Value; case "Watering Can": return ImmersiveScrapConfig.ConfigWateringCanSpawnWeight.Value; case "Wheel": return ImmersiveScrapConfig.ConfigWheelSpawnWeight.Value; case "Wine bottle": return ImmersiveScrapConfig.ConfigWineBottleSpawnWeight.Value; case "Wrench": return ImmersiveScrapConfig.ConfigWrenchSpawnWeight.Value; default: Logger.LogInfo((object)("No configuration found for item type: " + itemName)); return null; } } private static List<StringWithRarity> ConfigParsing(string configMoonRarity) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown List<StringWithRarity> list = new List<StringWithRarity>(); foreach (string item in from s in configMoonRarity.Split(",") select s.Trim()) { string[] array = item.Split(":"); if (array.Length == 2) { string text = array[0]; if (int.TryParse(array[1], out var result)) { list.Add(new StringWithRarity(text, result)); Logger.LogInfo((object)$"Registered spawn rate for {text} to {result}"); } } } return list; } private void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "ImmersiveScrap"; public const string PLUGIN_NAME = "ImmersiveScrap"; public const string PLUGIN_VERSION = "1.4.1"; } } namespace ImmersiveScrap.Misc { public class ThrowableNoisemaker : NoisemakerProp { public bool throwWithRight; public bool beingThrown; public AnimationCurve itemFallCurve; public AnimationCurve itemVerticalFallCurve; public AnimationCurve itemVerticalFallCurveNoBounce; public RaycastHit itemHit; public Ray itemThrowRay; public override void FallWithCurve() { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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 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, itemFallCurve.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), itemVerticalFallCurveNoBounce.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), itemVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } public override void ItemActivate(bool used, bool buttonDown = true) { } public Vector3 GetItemThrowDestination() { //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_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_003c: 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_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) //IL_007d: 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_0093: 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_0099: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; itemThrowRay = new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward); float num = 30f; position = ((!Physics.Raycast(itemThrowRay, ref itemHit, num, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? ((Ray)(ref itemThrowRay)).GetPoint(num) : ((Ray)(ref itemThrowRay)).GetPoint(((RaycastHit)(ref itemHit)).distance - 0.05f)); itemThrowRay = new Ray(position, Vector3.down); if (Physics.Raycast(itemThrowRay, ref itemHit, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref itemHit)).point + Vector3.up * 0.05f; } return ((Ray)(ref itemThrowRay)).GetPoint(30f); } protected override void __initializeVariables() { ((NoisemakerProp)this).__initializeVariables(); } protected internal override string __getTypeName() { return "ThrowableNoisemaker"; } } public class Utilities { private static Dictionary<int, int> _masksByLayer; public static void Init() { GenerateLayerMap(); } public static void GenerateLayerMap() { _masksByLayer = new Dictionary<int, int>(); for (int i = 0; i < 32; i++) { int num = 0; for (int j = 0; j < 32; j++) { if (!Physics.GetIgnoreLayerCollision(i, j)) { num |= 1 << j; } } _masksByLayer.Add(i, num); } } public static Transform TryFindRoot(Transform child) { Transform val = child; while ((Object)(object)val != (Object)null) { if ((Object)(object)((Component)val).GetComponent<NetworkObject>() != (Object)null) { return val; } val = ((Component)val).transform.parent; } return null; } public static int MaskForLayer(int layer) { return _masksByLayer[layer]; } public static void TeleportPlayer(int playerObj, Vector3 teleportPos) { //IL_004c: 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_0062: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>())) { Object.FindObjectOfType<AudioReverbPresets>().audioPresets[2].ChangeAudioReverbForPlayer(val); } val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = true; val.averageVelocity = 0f; val.velocityLastFrame = Vector3.zero; StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true); StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play(); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition) { //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) float startTime = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - startTime > 2f)); if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1) { yield break; } DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[playerObj].deadBody; if ((Object)(object)deadBody != (Object)null) { deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; if ((Object)(object)deadBody.grabBodyObject != (Object)null && deadBody.grabBodyObject.isHeld && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null) { deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false); } deadBody.isInShip = false; deadBody.parentedToShip = false; ((Component)deadBody).transform.SetParent((Transform)null, true); deadBody.SetRagdollPositionSafely(teleportPosition, true); } } public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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_0019: Unknown result type (might be due to invalid IL or missing references) enemy.serverPosition = teleportPos; ((Component)enemy).transform.position = teleportPos; enemy.agent.Warp(teleportPos); enemy.SyncPositionToClients(); } public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"Spawning explosion at pos: {explosionPosition}"); Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val2 = null; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } if (((Component)array[i]).gameObject.layer == 3) { val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner) { float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)); val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3)); } } else if (((Component)array[i]).gameObject.layer == 21) { Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f) { Debug.Log((object)"Setting off other mine"); ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1); } } } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); for (int j = 0; j < array.Length; j++) { Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(70f, explosionPosition, 10f); } } } } } namespace ImmersiveScrap.Scrap { public class Brick : ThrowableNoisemaker { public AudioClip[] cookieSpecialAudio; public AudioSource brickPlayer; private float explodePercentage = 100f; public bool wasThrown; private Random noiseMakerRandom; public override void Start() { ((NoisemakerProp)this).Start(); noiseMakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public void DetectThrowKeyPressed() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.InputActionsInstance.ThrowKey.triggered && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { wasThrown = true; Vector3 itemThrowDestination = GetItemThrowDestination(); ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, itemThrowDestination, true); PlayCookieAudioServerRpc(0); } } public override void Update() { ((GrabbableObject)this).Update(); if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer != (Object)(object)this)) { DetectThrowKeyPressed(); } } [ServerRpc] public void PlayCookieAudioServerRpc(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_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(3742843923u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3742843923u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayCookieAudioClientRpc(index); } } [ClientRpc] public void PlayCookieAudioClientRpc(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) //IL_0108: 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(2929058189u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2929058189u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && cookieSpecialAudio.Length != 0) { brickPlayer.PlayOneShot(cookieSpecialAudio[index]); WalkieTalkie.TransmitOneShotAudio(brickPlayer, cookieSpecialAudio[index], 0.5f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 15f, 0.5f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } } [ServerRpc] public void StopPlayingCookieAudioServerRpc() { //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(4170301725u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4170301725u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { StopPlayingCookieAudioClientRpc(); } } [ClientRpc] public void StopPlayingCookieAudioClientRpc() { //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(366094878u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 366094878u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { brickPlayer.Stop(); } } } [ClientRpc] public void BoomClientRpc() { //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(2731884806u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2731884806u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Boom(); } } } [ServerRpc] public void BoomServerRpc() { //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(3369954093u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3369954093u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Boom(); BoomClientRpc(); } } public void CreateExplosion() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); int num = 0; if (ImmersiveScrapConfig.ConfigBrickDealingDamage.Value) { num = ImmersiveScrapConfig.ConfigBrickDealingXDamage.Value; } Utilities.CreateExplosion(((Component)this).transform.position, ImmersiveScrapConfig.ConfigBrickExploding.Value, 20, 0f, num, 2, (CauseOfDeath)3, attacker); } public void Boom() { CreateExplosion(); } public override void OnHitGround() { if (wasThrown) { wasThrown = false; if (((NetworkBehaviour)this).IsOwner && (float)noiseMakerRandom.Next(0, 101) <= explodePercentage) { Boom(); BoomServerRpc(); } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Brick() { //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 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3742843923u, new RpcReceiveHandler(__rpc_handler_3742843923)); NetworkManager.__rpc_func_table.Add(2929058189u, new RpcReceiveHandler(__rpc_handler_2929058189)); NetworkManager.__rpc_func_table.Add(4170301725u, new RpcReceiveHandler(__rpc_handler_4170301725)); NetworkManager.__rpc_func_table.Add(366094878u, new RpcReceiveHandler(__rpc_handler_366094878)); NetworkManager.__rpc_func_table.Add(2731884806u, new RpcReceiveHandler(__rpc_handler_2731884806)); NetworkManager.__rpc_func_table.Add(3369954093u, new RpcReceiveHandler(__rpc_handler_3369954093)); } private static void __rpc_handler_3742843923(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((Brick)(object)target).PlayCookieAudioServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2929058189(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; ((Brick)(object)target).PlayCookieAudioClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4170301725(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; ((Brick)(object)target).StopPlayingCookieAudioServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_366094878(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; ((Brick)(object)target).StopPlayingCookieAudioClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2731884806(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; ((Brick)(object)target).BoomClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3369954093(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; ((Brick)(object)target).BoomServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Brick"; } } internal class HittingStuff : GrabbableObject { public int hammerHitForce = 1; public float hammerHitPercentage = 1f; public bool reelingUp; public bool isHoldingButton; private RaycastHit rayHit; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByHammer; private List<RaycastHit> objectsHitByHammerList = new List<RaycastHit>(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource hammerAudio; private PlayerControllerB previousPlayerHeldBy; private int hammerMask = 11012424; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer()); } } private IEnumerator reelUpHammer() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); hammerAudio.PlayOneShot(reelUp); ReelUpSFXServerRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld)); SwingHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); HitHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); 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(2951614796u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2951614796u, 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(989564174u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 989564174u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { hammerAudio.PlayOneShot(reelUp); } } } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public void SwingHammer(bool cancel = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { hammerAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitHammer(bool cancel = false) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0380: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f); objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2); objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; IHittable val3 = default(IHittable); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < objectsHitByHammerList.Count; i++) { RaycastHit val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8) { val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11) { val2 = objectsHitByHammerList[i]; if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3)) { continue; } val2 = objectsHitByHammerList[i]; if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val2 = objectsHitByHammerList[i]; if (!(((RaycastHit)(ref val2)).point == Vector3.zero)) { Vector3 val4 = val; val2 = objectsHitByHammerList[i]; if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; val3.Hit(hammerHitForce, forward, previousPlayerHeldBy, true, -1); continue; } } val2 = objectsHitByHammerList[i]; Vector3 point = ((RaycastHit)(ref val2)).point; val2 = objectsHitByHammerList[i]; val = point + ((RaycastHit)(ref val2)).normal * 0.01f; flag = true; val2 = objectsHitByHammerList[i]; string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { hammerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(hammerAudio, StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX, 1f); num = j; break; } } } } if (flag) { int soundID = RoundManager.PlayRandomClip(hammerAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); base.playerHeldBy.playerBodyAnimator.SetTrigger("hammerHit"); HitHammerServerRpc(soundID); } } [ServerRpc] public void HitHammerServerRpc(int soundID) { //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(2176195719u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2176195719u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { HitHammerClientRpc(soundID); } } [ClientRpc] public void HitHammerClientRpc(int soundID) { //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(3269527847u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3269527847u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { HitSurfaceWithHammer(soundID); } } } private void HitSurfaceWithHammer(int soundID) { if (!((NetworkBehaviour)this).IsOwner) { hammerAudio.PlayOneShot(hitSFX[soundID]); } WalkieTalkie.TransmitOneShotAudio(hammerAudio, hitSFX[soundID], 1f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_HittingStuff() { //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(2951614796u, new RpcReceiveHandler(__rpc_handler_2951614796)); NetworkManager.__rpc_func_table.Add(989564174u, new RpcReceiveHandler(__rpc_handler_989564174)); NetworkManager.__rpc_func_table.Add(2176195719u, new RpcReceiveHandler(__rpc_handler_2176195719)); NetworkManager.__rpc_func_table.Add(3269527847u, new RpcReceiveHandler(__rpc_handler_3269527847)); } private static void __rpc_handler_2951614796(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; ((HittingStuff)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_989564174(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; ((HittingStuff)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2176195719(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 soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)1; ((HittingStuff)(object)target).HitHammerServerRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3269527847(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 soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)2; ((HittingStuff)(object)target).HitHammerClientRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HittingStuff"; } } } namespace ImmersiveScrap.Weapons { public class BaseballBat : Shovel { protected override void __initializeVariables() { ((Shovel)this).__initializeVariables(); } protected internal override string __getTypeName() { return "BaseballBat"; } } public class Plunger : Shovel { protected override void __initializeVariables() { ((Shovel)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Plunger"; } } } namespace ImmersiveScrap.Keybinds { public class IngameKeybinds : LcInputActions { [InputAction("<Keyboard>/q", Name = "ThrowKeybind")] public InputAction ThrowKey { get; set; } } } namespace ImmersiveScrap.Configs { public class ImmersiveScrapConfig { public static ConfigEntry<int> ConfigVanillaSpawnWeight { get; private set; } public static ConfigEntry<int> ConfigCustomSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigAlcoholSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigAnvilSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigBaseballSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigBeercanSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigBrickSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigBrokenEngineSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigBucketSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigCanPaintSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigCanteenSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigCarBatterySpawnWeight { get; private set; } public static ConfigEntry<string> ConfigClampSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigClockSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFanSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFancyPaintingSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFireAxeSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFireExtingSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFireHydrantSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigFoodCanSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigGameboySpawnWeight { get; private set; } public static ConfigEntry<string> ConfigGarbageSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigHammerSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigJerryCanSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigKeyboardSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigLanternSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigLibraryLampSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigPlantSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigPliersSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigPlungerSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigRetroToySpawnWeight { get; private set; } public static ConfigEntry<string> ConfigScrewdriverSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigSinkSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigSocketSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigSqueakyToySpawnWeight { get; private set; } public static ConfigEntry<string> ConfigSuitcaseSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigToasterSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigToolboxSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigTophatSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigTrafficConeSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigVentSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigWateringCanSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigWheelSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigWineBottleSpawnWeight { get; private set; } public static ConfigEntry<string> ConfigWrenchSpawnWeight { get; private set; } public static ConfigEntry<bool> ConfigBrickExploding { get; private set; } public static ConfigEntry<bool> ConfigBrickDealingDamage { get; private set; } public static ConfigEntry<int> ConfigBrickDealingXDamage { get; private set; } public ImmersiveScrapConfig(ConfigFile configFile) { ConfigBrickExploding = configFile.Bind<bool>("Scrap Options", "Brick Exploding", false, "Enable/Disable Brick Exploding"); ConfigBrickDealingDamage = configFile.Bind<bool>("Scrap Options", "Brick Dealing Damage", false, "Enable/Disable Brick Dealing Damage"); ConfigBrickDealingXDamage = configFile.Bind<int>("Scrap Options", "Brick Dealing X Damage", 1, "Set how much damage the Brick deals"); ConfigAlcoholSpawnWeight = configFile.Bind<string>("Scrap Options", "Alcohol | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for alcohol scrap on moons"); ConfigAnvilSpawnWeight = configFile.Bind<string>("Scrap Options", "Anvil | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for anvil scrap on moons"); ConfigBaseballSpawnWeight = configFile.Bind<string>("Scrap Options", "Baseball | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for baseball scrap on moons"); ConfigBeercanSpawnWeight = configFile.Bind<string>("Scrap Options", "Beercan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for beer can scrap on moons"); ConfigBrickSpawnWeight = configFile.Bind<string>("Scrap Options", "Brick | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for brick scrap on moons"); ConfigCanteenSpawnWeight = configFile.Bind<string>("Scrap Options", "Canteen | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for canteen scrap on moons"); ConfigCarBatterySpawnWeight = configFile.Bind<string>("Scrap Options", "CarBattery | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for car battery scrap on moons"); ConfigFireAxeSpawnWeight = configFile.Bind<string>("Scrap Options", "FireAxe | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire axe scrap on moons"); ConfigFireExtingSpawnWeight = configFile.Bind<string>("Scrap Options", "FireExtinguisher | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire extinguisher scrap on moons"); ConfigFireHydrantSpawnWeight = configFile.Bind<string>("Scrap Options", "FireHydrant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire hydrant scrap on moons"); ConfigFoodCanSpawnWeight = configFile.Bind<string>("Scrap Options", "FoodCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for food can scrap on moons"); ConfigLibraryLampSpawnWeight = configFile.Bind<string>("Scrap Options", "LibraryLamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for library lamp scrap on moons"); ConfigPlantSpawnWeight = configFile.Bind<string>("Scrap Options", "Plant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plant scrap on moons"); ConfigPliersSpawnWeight = configFile.Bind<string>("Scrap Options", "Pliers | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for pliers scrap on moons"); ConfigPlungerSpawnWeight = configFile.Bind<string>("Scrap Options", "Plunger | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plunger scrap on moons"); ConfigTrafficConeSpawnWeight = configFile.Bind<string>("Scrap Options", "TrafficCone | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for traffic cone scrap on moons"); ConfigWateringCanSpawnWeight = configFile.Bind<string>("Scrap Options", "WateringCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for watering can scrap on moons"); ConfigWrenchSpawnWeight = configFile.Bind<string>("Scrap Options", "Wrench | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wrench scrap on moons"); ConfigBrokenEngineSpawnWeight = configFile.Bind<string>("Scrap Options", "BrokenEngine | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for broken engine scrap on moons"); ConfigBucketSpawnWeight = configFile.Bind<string>("Scrap Options", "Bucket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for bucket scrap on moons"); ConfigCanPaintSpawnWeight = configFile.Bind<string>("Scrap Options", "CanPaint | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for can of paint scrap on moons"); ConfigClampSpawnWeight = configFile.Bind<string>("Scrap Options", "Clamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clamp scrap on moons"); ConfigClockSpawnWeight = configFile.Bind<string>("Scrap Options", "Clock | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clock scrap on moons"); ConfigFanSpawnWeight = configFile.Bind<string>("Scrap Options", "Fan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fan scrap on moons"); ConfigFancyPaintingSpawnWeight = configFile.Bind<string>("Scrap Options", "FancyPainting | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fancy painting scrap on moons"); ConfigGarbageSpawnWeight = configFile.Bind<string>("Scrap Options", "Garbage | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for garbage scrap on moons"); ConfigGameboySpawnWeight = configFile.Bind<string>("Scrap Options", "Gameboy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for Gameboy scrap on moons"); ConfigHammerSpawnWeight = configFile.Bind<string>("Scrap Options", "Hammer | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for hammer scrap on moons"); ConfigJerryCanSpawnWeight = configFile.Bind<string>("Scrap Options", "JerryCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for jerry can scrap on moons"); ConfigKeyboardSpawnWeight = configFile.Bind<string>("Scrap Options", "Keyboard | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for keyboard scrap on moons"); ConfigLanternSpawnWeight = configFile.Bind<string>("Scrap Options", "Lantern | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for lantern scrap on moons"); ConfigRetroToySpawnWeight = configFile.Bind<string>("Scrap Options", "RetroToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for retro toy scrap on moons"); ConfigScrewdriverSpawnWeight = configFile.Bind<string>("Scrap Options", "Screwdriver | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for screwdriver scrap on moons"); ConfigSinkSpawnWeight = configFile.Bind<string>("Scrap Options", "Sink | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for sink scrap on moons"); ConfigSocketSpawnWeight = configFile.Bind<string>("Scrap Options", "Socket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for socket scrap on moons"); ConfigSqueakyToySpawnWeight = configFile.Bind<string>("Scrap Options", "SqueakyToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for squeaky toy scrap on moons"); ConfigSuitcaseSpawnWeight = configFile.Bind<string>("Scrap Options", "Suitcase | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for suitcase scrap on moons"); ConfigToasterSpawnWeight = configFile.Bind<string>("Scrap Options", "Toaster | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toaster scrap on moons"); ConfigToolboxSpawnWeight = configFile.Bind<string>("Scrap Options", "Toolbox | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toolbox scrap on moons"); ConfigTophatSpawnWeight = configFile.Bind<string>("Scrap Options", "Tophat | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for top hat scrap on moons"); ConfigVentSpawnWeight = configFile.Bind<string>("Scrap Options", "Vent | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for vent scrap on moons"); ConfigWheelSpawnWeight = configFile.Bind<string>("Scrap Options", "Wheel | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wheel scrap on moons"); ConfigWineBottleSpawnWeight = configFile.Bind<string>("Scrap Options", "WineBottle | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wine bottle scrap on moons"); ClearUnusedEntries(configFile); Plugin.Logger.LogInfo((object)"Setting up config for ImmersiveScrap plugin..."); } private void ClearUnusedEntries(ConfigFile configFile) { PropertyInfo property = ((object)configFile).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(configFile, null); dictionary.Clear(); configFile.Save(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace ImmersiveScrap.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }
plugins/LCGoldScrapMod.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; using System.Xml.Serialization; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DunGen; using GameNetcodeStuff; using HarmonyLib; using HarmonyLib.Tools; using LethalConfig; using LethalConfig.ConfigItems; using STSharedAudioLib; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] internal class <Module> { static <Module>() { } } [CreateAssetMenu(menuName = "LCGoldScrapMod/ArtOfGoldMaterials", order = 1)] public class ArtOfGoldMaterials : ScriptableObject { public List<Material> allArtwork; public List<Material> allSillyArtwork; } public enum GoldScrapLevels { Experimentation, Assurance, Vow, Offense, March, Rend, Dine, Titan, Adamance, Artifice, Embrion } [CreateAssetMenu(menuName = "LCGoldScrapMod/ItemData", order = 0)] public class ItemData : ScriptableObject { [Header("Item")] [Tooltip("The LCGoldScrapMod itemProperties the game will read from on the host.")] public Item itemProperties; [Tooltip("If true, it will be registered to levels and its itemProperties' weight, max-, and minValues will be put through the configMultipliers.\nIf false, only weight will be multiplied by its configMultiplier.")] public bool isScrap = true; [Tooltip("If true, its value will not be counted when collected in levels and when sold on the Company desk.")] public bool isStoreItem; [Space(3f)] [Header("Defaults")] [Tooltip("The intended default weight not yet taking the default 1.5x weightMultiplier into account.\nUsually the weight of the original item, unless that has no weight.")] public float defaultWeight = 1f; [Tooltip("The intended default maxValue not yet taking the default 2x maxValueMultiplier into account.\nUsually the maxValue of the original item.")] public int defaultMaxValue; [Tooltip("The intended default minValue not yet taking the default 2.5x minValueMultiplier into account.\nUsually the minValue of the original item.")] public int defaultMinValue; [Tooltip("The intended default rarity not yet taking the custom plusGain and minusLoss into account.\nRefer to 'GoldScrap - Items' document.")] public int defaultRarity = 3; [Space(3f)] [Header("Levels")] [Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity - 1' into account.")] public GoldScrapLevels[] levelsToAddMinus; [Tooltip("The vanilla levels where this gold scrap can appear.\nOnly takes Default Rarity into account.")] public GoldScrapLevels[] levelsToAddDefault; [Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity + 2' into account.")] public GoldScrapLevels[] levelsToAddPlus; [Tooltip("A custom positive gain or negative loss that will influence the Default Rarity of gold scrap on levels selected in 'Levels To Add Custom'.\nWill have no effect if Default Rarity is 2 or smaller and Custom Change is -2 or lower.")] public int customChange; [Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity + Custom Change' into account.")] public GoldScrapLevels[] levelsToAddCustom; [Space(3f)] [Header("Host values")] [HideInInspector] public int localMaxValue; [HideInInspector] public int localMinValue; } [CreateAssetMenu(menuName = "LCGoldScrapMod/List/AudioClipList")] public class AudioClipList : ScriptableObject { public List<AudioClip> allClips = new List<AudioClip>(); } [CreateAssetMenu(menuName = "LCGoldScrapMod/List/GameObjectList")] public class GameObjectList : ScriptableObject { public GameObject[] allPrefabs; } [CreateAssetMenu(menuName = "LCGoldScrapMod/List/ItemDataList")] public class ItemDataList : ScriptableObject { public ItemData[] allItemData; } [CreateAssetMenu(menuName = "LCGoldScrapMod/List/StringList")] public class StringList : ScriptableObject { [TextArea(1, 20)] public string[] allStrings; } public interface IGoldenGlassSecret { void BeginReveal(); void EndReveal(); } public class GoldBirdScript : GrabbableObject { [HarmonyPatch(typeof(HUDManager), "RadiationWarningHUD")] public class NewHUDManagerRadiationWarning { [HarmonyPostfix] public static void AwakenGoldBirds() { if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && GameNetworkManager.Instance.localPlayerController.isHostPlayerObject) { GoldBirdScript[] array = Object.FindObjectsOfType<GoldBirdScript>(); foreach (GoldBirdScript obj in array) { obj.AwakenClientRpc((int)((float)((GrabbableObject)obj).scrapValue * Random.Range(3f, 4f))); } } } } private static ManualLogSource Logger = Plugin.Logger; [Space(3f)] [Header("Alarm")] public AudioSource alarmSource; public AudioClip alarmClip; private float alarmTimer; private bool canAlarmFire; [Space(3f)] [Header("Spotlight")] public AudioSource spotlightAudio; public AudioClip lightOnClip; public AudioClip lightOffClip; public Light headlight; public Color normalColor; public Color alarmColor; [Space(3f)] [Header("Dormancy")] public AudioSource awakeSource; public AudioClip awakeClip; public AudioClip dieClip; public bool dormant = true; public ScanNodeProperties scanNode; private bool canWakeThisRound = true; public override void Start() { ((GrabbableObject)this).Start(); alarmSource.clip = alarmClip; if (base.isInShipRoom) { canWakeThisRound = false; } else { scanNode.headerText = "Gold Bird (Dormant)"; } } public override void Update() { ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsServer || dormant) { return; } canAlarmFire = (Object)(object)base.playerHeldBy != (Object)null && StartOfRound.Instance.shipDoorsEnabled && !StartOfRound.Instance.inShipPhase; if (!canAlarmFire && alarmTimer < 0.1f) { alarmTimer = 0.1f; ToggleAlarmClientRpc(alarm: false); return; } alarmTimer += Time.deltaTime; if (alarmTimer > 2f) { alarmTimer = 0f; DoAlarmInterval(); } } private void DoAlarmInterval() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (canAlarmFire) { if (IsNearbyPlayerInSight()) { ToggleAlarmClientRpc(alarm: true); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, alarmSource.maxDistance + 15f, 1f, 0, false, 0); } else { ToggleAlarmClientRpc(alarm: false); } } } private bool IsNearbyPlayerInSight() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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) if (StartOfRound.Instance.connectedPlayersAmount > 0) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)base.playerHeldBy) && val.isPlayerControlled && !(Vector3.Distance(((Component)headlight).transform.position, ((Component)val).transform.position) > alarmSource.maxDistance - 15f)) { return !Physics.Linecast(((Component)headlight).transform.position, val.playerEye.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1); } } } return false; } [ClientRpc] private void ToggleAlarmClientRpc(bool alarm) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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(3862976390u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref alarm, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3862976390u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (!((Behaviour)headlight).enabled) { ((Behaviour)headlight).enabled = true; } if (alarm && !alarmSource.isPlaying) { spotlightAudio.PlayOneShot(lightOnClip); alarmSource.Play(); headlight.color = alarmColor; } else if (!alarm && alarmSource.isPlaying) { spotlightAudio.PlayOneShot(lightOffClip); alarmSource.Stop(); headlight.color = normalColor; } } } [ClientRpc] public void AwakenClientRpc(int awakenedValue) { //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_0171: 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) 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(4211676833u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, awakenedValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4211676833u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}: canWake {canWakeThisRound} // dormant {dormant}"); if (canWakeThisRound && dormant) { Logger.LogDebug((object)"awakening"); awakeSource.PlayOneShot(awakeClip); WalkieTalkie.TransmitOneShotAudio(awakeSource, awakeClip, 0.5f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, awakeSource.maxDistance, 0.1f, 0, false, 0); ((Behaviour)headlight).enabled = true; headlight.color = normalColor; dormant = false; canWakeThisRound = false; if (scanNode.headerText.Contains("(Dormant)")) { scanNode.headerText = scanNode.headerText.Replace("Dormant", "Awake"); } ((GrabbableObject)this).SetScrapValue(awakenedValue); } } [ClientRpc] public void DeactivateAtEndOfDayClientRpc() { //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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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(634004460u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 634004460u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !canWakeThisRound) { return; } canWakeThisRound = false; Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} can no longer wake"); if (dormant) { if (scanNode.headerText.Contains("(Dormant)")) { scanNode.headerText = scanNode.headerText.Replace("Dormant", "Dead"); } spotlightAudio.PlayOneShot(dieClip); Object.Instantiate<GameObject>(AssetsCollection.poofParticle, ((Component)headlight).transform.position, new Quaternion(0f, 0f, 0f, 0f)).GetComponent<ParticleSystem>().Play(); } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(2991509102u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2991509102u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncUponJoinClientRpc(canWakeThisRound, ((Behaviour)headlight).enabled, scanNode.headerText, playerID); } } } [ClientRpc] private void SyncUponJoinClientRpc(bool hostCanWakeValue, bool enableHeadlight, string scanNodeName, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_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_00be: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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(1832698290u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostCanWakeValue, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enableHeadlight, default(ForPrimitives)); bool flag = scanNodeName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(scanNodeName, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1832698290u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId) { canWakeThisRound = hostCanWakeValue; ((Behaviour)headlight).enabled = enableHeadlight; if (enableHeadlight) { headlight.color = (alarmSource.isPlaying ? alarmColor : normalColor); } scanNode.headerText = scanNodeName; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_GoldBirdScript() { //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 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3862976390u, new RpcReceiveHandler(__rpc_handler_3862976390)); NetworkManager.__rpc_func_table.Add(4211676833u, new RpcReceiveHandler(__rpc_handler_4211676833)); NetworkManager.__rpc_func_table.Add(634004460u, new RpcReceiveHandler(__rpc_handler_634004460)); NetworkManager.__rpc_func_table.Add(2991509102u, new RpcReceiveHandler(__rpc_handler_2991509102)); NetworkManager.__rpc_func_table.Add(1832698290u, new RpcReceiveHandler(__rpc_handler_1832698290)); } private static void __rpc_handler_3862976390(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 alarm = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref alarm, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldBirdScript)(object)target).ToggleAlarmClientRpc(alarm); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4211676833(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 awakenedValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref awakenedValue); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldBirdScript)(object)target).AwakenClientRpc(awakenedValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_634004460(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; ((GoldBirdScript)(object)target).DeactivateAtEndOfDayClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2991509102(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldBirdScript)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1832698290(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_004a: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hostCanWakeValue = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostCanWakeValue, default(ForPrimitives)); bool enableHeadlight = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enableHeadlight, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string scanNodeName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref scanNodeName, false); } int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldBirdScript)(object)target).SyncUponJoinClientRpc(hostCanWakeValue, enableHeadlight, scanNodeName, playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldBirdScript"; } } public class GoldenClockScript : GrabbableObject { private static ManualLogSource Logger = Plugin.Logger; [Space(3f)] [Header("Original Clock")] public Transform minuteHand; public Transform secondHand; private float timeOfLastSecond; public AudioSource tickAudio; public AudioClip tickSFX; public AudioClip tockSFX; private bool tickOrTock; [Space(3f)] [Header("Custom Timer")] public AudioClip intervalClip; public AudioClip failClip; public int maxRealSeconds; public int minRealSeconds; public float countdownInterval; [Space(3f)] [Header("Close Call")] public AudioSource closeCallAudio; public AudioClip closeCallApproach; public AudioClip closeCallSuccess; public AudioClip closeCallFail; private bool shouldCountDown; private bool approachedShipFinalPhase; private int secondsLeft; private int thisClocksStartingSeconds; private int thisClocksStartingValue; private int thisClocksIntervalAmount; private int thisClocksSpecialMultiplier; private float timeOfLastTickTock; public override void Start() { ((GrabbableObject)this).Start(); if (((NetworkBehaviour)this).IsServer && !base.isInShipRoom) { ((MonoBehaviour)this).StartCoroutine(RollForNewTimer()); } } public override void Update() { //IL_0118: 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) ((GrabbableObject)this).Update(); if (!shouldCountDown) { return; } if (Time.realtimeSinceStartup - timeOfLastSecond > countdownInterval) { timeOfLastSecond = Time.realtimeSinceStartup; if (((NetworkBehaviour)this).IsServer || (!((NetworkBehaviour)this).IsServer && secondsLeft % 60 != 1)) { secondsLeft--; secondHand.Rotate(6f, 0f, 0f, (Space)1); } if (((NetworkBehaviour)this).IsServer) { if (secondsLeft <= 0) { shouldCountDown = false; SyncFailureClientRpc(base.scrapValue / thisClocksSpecialMultiplier); return; } if (secondsLeft % 60 == 0) { SyncTimeAndValueClientRpc(secondsLeft, base.scrapValue - (int)Mathf.Lerp(0f, (float)thisClocksStartingValue, (float)(Random.Range(40, 70) / thisClocksIntervalAmount) / 100f), isMinute: true); } if (secondsLeft < 60 && !approachedShipFinalPhase && (Object)(object)base.playerHeldBy != (Object)null && Vector3.Distance(((Component)base.playerHeldBy).transform.position, ((Component)StartOfRound.Instance.shipDoorNode).transform.position) < 10f) { approachedShipFinalPhase = true; SyncApproachClientRpc(); } } if (secondsLeft > 60) { TickTock(); } } if (secondsLeft <= 60 && Time.realtimeSinceStartup - timeOfLastTickTock > countdownInterval / 2f) { TickTock(); } } public override void OnBroughtToShip() { ((GrabbableObject)this).OnBroughtToShip(); if (shouldCountDown) { SyncSuccessServerRpc(); } } private IEnumerator RollForNewTimer() { yield return (object)new WaitUntil((Func<bool>)(() => StartOfRound.Instance.shipHasLanded)); int num = Random.Range(minRealSeconds, maxRealSeconds); int num2 = (int)((float)num / countdownInterval); int intervalAmount = num2 / 60; int num3 = Mathf.Clamp(TimeOfDay.Instance.daysUntilDeadline, 1, 3) + 1; int num4 = base.scrapValue * num3 + (maxRealSeconds - num) / 2; if (RarityManager.CurrentlyGoldFever()) { num4 *= 2; } SendNewTimerClientRpc(num2, intervalAmount, num3, num4); } [ClientRpc] private void SendNewTimerClientRpc(int startingSeconds, int intervalAmount, int specialMultiplier, int startingValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_008b: 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_00b0: 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(724639717u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, startingSeconds); BytePacker.WriteValueBitPacked(val2, intervalAmount); BytePacker.WriteValueBitPacked(val2, specialMultiplier); BytePacker.WriteValueBitPacked(val2, startingValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 724639717u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { thisClocksStartingSeconds = startingSeconds; thisClocksIntervalAmount = intervalAmount; thisClocksSpecialMultiplier = specialMultiplier; thisClocksStartingValue = startingValue; shouldCountDown = true; minuteHand.Rotate(-20f * (float)(thisClocksIntervalAmount % 18), 0f, 0f, (Space)1); SetTimerRotationAndValue(thisClocksStartingSeconds, isMinute: false, thisClocksStartingValue); Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}:"); Logger.LogDebug((object)$"{thisClocksStartingSeconds}"); Logger.LogDebug((object)$"{thisClocksIntervalAmount}"); Logger.LogDebug((object)$"{thisClocksSpecialMultiplier}"); Logger.LogDebug((object)$"{thisClocksStartingValue}"); } } } private void SetTimerRotationAndValue(int seconds, bool isMinute = false, int newScrapValue = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) secondsLeft = seconds; if (isMinute) { secondHand.localRotation = new Quaternion(0f, 0f, 0f, 0f); } else { secondHand.Rotate(-6f * (float)(seconds % 60), 0f, 0f, (Space)1); } if (newScrapValue != -1) { ((GrabbableObject)this).SetScrapValue(newScrapValue); } } [ClientRpc] private void SyncTimeAndValueClientRpc(int hostSecondsLeft, int newScrapValue, bool isMinute) { //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) //IL_0127: 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(173399023u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hostSecondsLeft); BytePacker.WriteValueBitPacked(val2, newScrapValue); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isMinute, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 173399023u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { minuteHand.Rotate(20f, 0f, 0f, (Space)1); tickAudio.PlayOneShot(intervalClip); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 5f, 0.5f, 0, false, 0); WalkieTalkie.TransmitOneShotAudio(tickAudio, intervalClip, 1f); SetTimerRotationAndValue(hostSecondsLeft, isMinute, newScrapValue); } } } [ServerRpc(RequireOwnership = false)] private void SyncSuccessServerRpc() { //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(1373350663u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1373350663u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncSuccessClientRpc(secondsLeft < 60); } } } [ClientRpc] private void SyncSuccessClientRpc(bool inFinalPhase) { //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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2850989775u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inFinalPhase, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2850989775u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { shouldCountDown = false; tickAudio.PlayOneShot(intervalClip); WalkieTalkie.TransmitOneShotAudio(tickAudio, intervalClip, 1f); if (inFinalPhase) { closeCallAudio.Stop(); closeCallAudio.PlayOneShot(closeCallSuccess); WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallSuccess, 1f); } } } [ClientRpc] private void SyncFailureClientRpc(int failedScrapValue) { //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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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) 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(3360715093u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, failedScrapValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3360715093u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { shouldCountDown = false; secondsLeft = 0; tickAudio.PlayOneShot(failClip); WalkieTalkie.TransmitOneShotAudio(tickAudio, failClip, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 15f, 1f, 0, false, 0); ((GrabbableObject)this).SetScrapValue(failedScrapValue); secondHand.localRotation = new Quaternion(0f, 0f, 0f, 0f); minuteHand.localRotation = new Quaternion(0f, 0f, 0f, 0f); if (approachedShipFinalPhase) { closeCallAudio.Stop(); closeCallAudio.PlayOneShot(closeCallFail); WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallFail, 1f); } } } [ClientRpc] private void SyncApproachClientRpc() { //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(2869504692u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2869504692u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { approachedShipFinalPhase = true; closeCallAudio.PlayOneShot(closeCallApproach); WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallApproach, 1f); } } } private void TickTock() { tickOrTock = !tickOrTock; AudioClip val = (tickOrTock ? tickSFX : tockSFX); tickAudio.PlayOneShot(val); WalkieTalkie.TransmitOneShotAudio(tickAudio, val, 0.33f); timeOfLastTickTock = Time.realtimeSinceStartup; } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(118909299u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 118909299u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncUponJoinClientRpc(shouldCountDown, secondsLeft, playerID); } } } [ClientRpc] private void SyncUponJoinClientRpc(bool hostBroughtToShip, int hostSecondsLeft, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3919497654u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostBroughtToShip, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, hostSecondsLeft); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3919497654u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId) { shouldCountDown = hostBroughtToShip; SetTimerRotationAndValue(hostSecondsLeft); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_GoldenClockScript() { //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 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(724639717u, new RpcReceiveHandler(__rpc_handler_724639717)); NetworkManager.__rpc_func_table.Add(173399023u, new RpcReceiveHandler(__rpc_handler_173399023)); NetworkManager.__rpc_func_table.Add(1373350663u, new RpcReceiveHandler(__rpc_handler_1373350663)); NetworkManager.__rpc_func_table.Add(2850989775u, new RpcReceiveHandler(__rpc_handler_2850989775)); NetworkManager.__rpc_func_table.Add(3360715093u, new RpcReceiveHandler(__rpc_handler_3360715093)); NetworkManager.__rpc_func_table.Add(2869504692u, new RpcReceiveHandler(__rpc_handler_2869504692)); NetworkManager.__rpc_func_table.Add(118909299u, new RpcReceiveHandler(__rpc_handler_118909299)); NetworkManager.__rpc_func_table.Add(3919497654u, new RpcReceiveHandler(__rpc_handler_3919497654)); } private static void __rpc_handler_724639717(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_003d: 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_005d: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int startingSeconds = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref startingSeconds); int intervalAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref intervalAmount); int specialMultiplier = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref specialMultiplier); int startingValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref startingValue); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenClockScript)(object)target).SendNewTimerClientRpc(startingSeconds, intervalAmount, specialMultiplier, startingValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_173399023(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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hostSecondsLeft = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSecondsLeft); int newScrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newScrapValue); bool isMinute = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isMinute, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenClockScript)(object)target).SyncTimeAndValueClientRpc(hostSecondsLeft, newScrapValue, isMinute); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1373350663(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; ((GoldenClockScript)(object)target).SyncSuccessServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2850989775(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 inFinalPhase = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref inFinalPhase, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenClockScript)(object)target).SyncSuccessClientRpc(inFinalPhase); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3360715093(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 failedScrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref failedScrapValue); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenClockScript)(object)target).SyncFailureClientRpc(failedScrapValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2869504692(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; ((GoldenClockScript)(object)target).SyncApproachClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_118909299(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenClockScript)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3919497654(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hostBroughtToShip = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostBroughtToShip, default(ForPrimitives)); int hostSecondsLeft = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hostSecondsLeft); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenClockScript)(object)target).SyncUponJoinClientRpc(hostBroughtToShip, hostSecondsLeft, playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldenClockScript"; } } public class GoldenGirlScript : GrabbableObject, IGoldenGlassSecret { private static ManualLogSource Logger = Plugin.Logger; private Mesh loadedMesh; private bool broughtToShip; private bool choseLocalPlayer; [Space(3f)] [Header("(In)visibility")] public MeshFilter meshToToggle; public MeshRenderer materialToToggle; public AudioSource audioToMute; [Space(3f)] [Header("Audiovisual feedback")] public AudioSource reappearSource; public AudioClip reappearClip; public override void Start() { ((GrabbableObject)this).Start(); loadedMesh = ((Component)this).GetComponent<MeshFilter>().mesh; if (((NetworkBehaviour)this).IsServer) { if (base.isInShipRoom) { broughtToShip = true; } else { ChoosePlayer(); } } } private void ChoosePlayer() { if (base.isInFactory && !base.isInShipRoom) { ChoosePlayerClientRpc((int)General.GetRandomPlayer().playerClientId); } } [ClientRpc] private void ChoosePlayerClientRpc(int playerClientId) { //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(2685509517u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerClientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2685509517u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Logger.LogDebug((object)$"#{((NetworkBehaviour)this).NetworkObjectId}: [{playerClientId}]"); if ((Object)(object)StartOfRound.Instance.allPlayerScripts[playerClientId] == (Object)(object)StartOfRound.Instance.localPlayerController) { choseLocalPlayer = true; } else { ((MonoBehaviour)this).StartCoroutine(ToggleOnDelay()); } } } private IEnumerator ToggleOnDelay() { yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)loadedMesh != (Object)null)); ToggleGirl(enabled: false); } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (!broughtToShip && !choseLocalPlayer) { ToggleGirl(enabled: false); } } public override void OnBroughtToShip() { ((GrabbableObject)this).OnBroughtToShip(); if (((NetworkBehaviour)this).IsOwner && !broughtToShip) { ReappearForEveryoneServerRpc(); } } private void ToggleGirl(bool enabled) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) meshToToggle.mesh = (enabled ? loadedMesh : null); audioToMute.volume = (enabled ? 1 : 0); Collider[] propColliders = base.propColliders; for (int i = 0; i < propColliders.Length; i++) { ((Collider)(BoxCollider)propColliders[i]).enabled = enabled; } if (!enabled && (Object)(object)base.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } if (enabled && !StartOfRound.Instance.inShipPhase) { reappearSource.PlayOneShot(reappearClip); Object.Instantiate<GameObject>(AssetsCollection.poofParticle, ((Component)this).transform.position, new Quaternion(0f, 0f, 0f, 0f)).GetComponent<ParticleSystem>().Play(); } if (enabled) { ((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGold; } } [ServerRpc(RequireOwnership = false)] private void ReappearForEveryoneServerRpc() { //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(247589533u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 247589533u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReappearForEveryoneClientRpc(); } } } [ClientRpc] private void ReappearForEveryoneClientRpc() { //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(958526731u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 958526731u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { broughtToShip = true; if (!choseLocalPlayer) { ToggleGirl(enabled: true); } } } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(2777299986u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2777299986u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncUponJoinClientRpc(broughtToShip, playerID); } } } [ClientRpc] private void SyncUponJoinClientRpc(bool onShip, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) 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(4022450178u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref onShip, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4022450178u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId) { broughtToShip = onShip; } } } void IGoldenGlassSecret.BeginReveal() { if (!Config.hostToolRebalance && !broughtToShip && !choseLocalPlayer) { meshToToggle.mesh = loadedMesh; ((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGoldTransparent; } } void IGoldenGlassSecret.EndReveal() { if (!broughtToShip && !choseLocalPlayer) { meshToToggle.mesh = null; ((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGold; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_GoldenGirlScript() { //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 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2685509517u, new RpcReceiveHandler(__rpc_handler_2685509517)); NetworkManager.__rpc_func_table.Add(247589533u, new RpcReceiveHandler(__rpc_handler_247589533)); NetworkManager.__rpc_func_table.Add(958526731u, new RpcReceiveHandler(__rpc_handler_958526731)); NetworkManager.__rpc_func_table.Add(2777299986u, new RpcReceiveHandler(__rpc_handler_2777299986)); NetworkManager.__rpc_func_table.Add(4022450178u, new RpcReceiveHandler(__rpc_handler_4022450178)); } private static void __rpc_handler_2685509517(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 playerClientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenGirlScript)(object)target).ChoosePlayerClientRpc(playerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_247589533(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; ((GoldenGirlScript)(object)target).ReappearForEveryoneServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_958526731(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; ((GoldenGirlScript)(object)target).ReappearForEveryoneClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2777299986(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenGirlScript)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4022450178(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool onShip = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref onShip, default(ForPrimitives)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenGirlScript)(object)target).SyncUponJoinClientRpc(onShip, playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldenGirlScript"; } } public class GoldenGlassScript : GrabbableObject { private static ManualLogSource Logger = Plugin.Logger; private Coroutine beginRevealCoroutine; private Coroutine endRevealCoroutine; [Space(3f)] [Header("Audiovisual")] public AudioSource audio2D; public AudioClip beginRevealClip; public AudioClip endRevealClip; [Tooltip("The fewer reveals per frame, the better performance, but the slower things will appear/disappear on-screen when using the Glass.")] public int revealPerFrame; public override void InspectItem() { ((GrabbableObject)this).InspectItem(); if (base.playerHeldBy.IsInspectingItem) { StartAndStopCoroutine(beginReveal: true); } else { StartAndStopCoroutine(beginReveal: false); } } public override void PocketItem() { if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { StartAndStopCoroutine(beginReveal: false, base.playerHeldBy.IsInspectingItem); } ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { StartAndStopCoroutine(beginReveal: false, base.playerHeldBy.IsInspectingItem); ((GrabbableObject)this).DiscardItem(); } private void StartAndStopCoroutine(bool beginReveal, bool playClip = true) { if (beginReveal) { if (endRevealCoroutine != null) { Logger.LogDebug((object)"!!!STOPPING END REVEAL COROUTINE!!!"); ((MonoBehaviour)this).StopCoroutine(endRevealCoroutine); endRevealCoroutine = null; } beginRevealCoroutine = ((MonoBehaviour)this).StartCoroutine(BeginRevealLocal(playClip)); } else { if (beginRevealCoroutine != null) { Logger.LogDebug((object)"!!!STOPPING BEGIN REVEAL COROUTINE!!!"); ((MonoBehaviour)this).StopCoroutine(beginRevealCoroutine); beginRevealCoroutine = null; } endRevealCoroutine = ((MonoBehaviour)this).StartCoroutine(EndRevealLocal(playClip)); } } private IEnumerator BeginRevealLocal(bool playClip = true) { if (!playClip) { yield break; } audio2D.Stop(); audio2D.PlayOneShot(beginRevealClip); int num = 0; GoldScrapObject[] array = Object.FindObjectsOfType<GoldScrapObject>(); GoldScrapObject[] array2 = array; foreach (GoldScrapObject goldScrapObject in array2) { if (RarityManager.CurrentlyGoldFever() && (Object)(object)goldScrapObject.item != (Object)null) { SetAllItemsScanNodes(goldScrapObject.item, setTo: true); } IGoldenGlassSecret component = ((Component)goldScrapObject).GetComponent<IGoldenGlassSecret>(); if (component != null) { Logger.LogDebug((object)("BEGIN revealing " + ((Object)((Component)goldScrapObject).gameObject).name)); component.BeginReveal(); num++; if (num >= revealPerFrame) { yield return null; num = 0; } } } beginRevealCoroutine = null; } private IEnumerator EndRevealLocal(bool playClip = true) { if (!playClip) { yield break; } audio2D.Stop(); audio2D.PlayOneShot(endRevealClip); int num = 0; GoldScrapObject[] array = Object.FindObjectsOfType<GoldScrapObject>(); GoldScrapObject[] array2 = array; foreach (GoldScrapObject goldScrapObject in array2) { if ((StartOfRound.Instance.inShipPhase || RarityManager.CurrentlyGoldFever()) && (Object)(object)goldScrapObject.item != (Object)null) { SetAllItemsScanNodes(goldScrapObject.item, setTo: false); } IGoldenGlassSecret component = ((Component)goldScrapObject).GetComponent<IGoldenGlassSecret>(); if (component != null) { Logger.LogDebug((object)("STOP revealing " + ((Object)((Component)goldScrapObject).gameObject).name)); component.EndReveal(); num++; if (num >= revealPerFrame) { yield return null; num = 0; } } } endRevealCoroutine = null; } private void SetAllItemsScanNodes(GrabbableObject item, bool setTo) { ScanNodeProperties componentInChildren = ((Component)item).gameObject.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { if (setTo && !item.isInShipRoom) { componentInChildren.maxRange = (Config.hostToolRebalance ? 128 : 256); componentInChildren.requiresLineOfSight = false; } else if (!setTo) { componentInChildren.maxRange = 13; componentInChildren.requiresLineOfSight = true; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "GoldenGlassScript"; } } public class GoldenGuardianScript : GrabbableObject { [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] public class NewPlayerDamage { [HarmonyPrefix] public static bool PreventDamage(PlayerControllerB __instance) { return PatchToPreventDamage(__instance, isKillCommand: false); } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] public class NewPlayerKill { [HarmonyPrefix] public static bool PreventKill(PlayerControllerB __instance) { return PatchToPreventDamage(__instance, isKillCommand: true); } } private static ManualLogSource Logger = Plugin.Logger; private bool aboutToExplode; private Coroutine explosionCoroutine; [Space(3f)] [Header("Audiovisual")] public AudioSource audioSource; public AudioClip buildUpClip; public AudioClip explodeClip; public GameObject stunGrenadeExplosion; public override void Update() { ((GrabbableObject)this).Update(); if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy == (Object)null) && (Object)(object)base.playerHeldBy.inAnimationWithEnemy != (Object)null && !aboutToExplode) { LocalPlayerStartExplosion(delay: true); } } public void LocalPlayerStartExplosion(bool delay = false, bool fromKillCommand = false) { float delayTime = 1.75f; if (Config.hostToolRebalance) { delayTime = 1.3f; delay = true; } if (fromKillCommand) { delay = false; } StartExplosion(delay, delayTime); StartExplosionServerRpc(delay, delayTime, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } private void StartExplosion(bool delay, float delayTime) { Logger.LogDebug((object)$"{((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId} called StartExplosion with delay {delay} and delayTime {delayTime}"); aboutToExplode = true; if (delay) { explosionCoroutine = ((MonoBehaviour)this).StartCoroutine(ExplodeOnDelay(delayTime)); return; } if (explosionCoroutine != null) { Logger.LogDebug((object)"interrupting coroutine to explode immediately!"); ((MonoBehaviour)this).StopCoroutine(explosionCoroutine); } Explode(); } private IEnumerator ExplodeOnDelay(float delayTime = 1.75f) { yield return (object)new WaitForSeconds(0.1f); audioSource.PlayOneShot(buildUpClip); WalkieTalkie.TransmitOneShotAudio(audioSource, buildUpClip, 0.5f); yield return (object)new WaitForSeconds(delayTime); Explode(); } public void Explode() { //IL_00e6: 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_007b: 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_00d2: Unknown result type (might be due to invalid IL or missing references) if (!base.deactivated) { audioSource.Stop(); ((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy); if (!Config.hostToolRebalance) { audioSource.PlayOneShot(explodeClip); WalkieTalkie.TransmitOneShotAudio(audioSource, explodeClip, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 25f, 0.3f, 0, false, 0); StunGrenadeItem.StunExplosion(((Component)this).transform.position, true, 0.2f, 10f, 1f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f); Transform val = (base.isInElevator ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.mapPropsContainer.transform); Object.Instantiate<GameObject>(stunGrenadeExplosion, ((Component)this).transform.position, Quaternion.identity, val); } else { Landmine.SpawnExplosion(((Component)this).transform.position, true, 4f, 8f, 25, 5f, (GameObject)null, false); } ((MonoBehaviour)this).StartCoroutine(DelaySettingObjectAway()); } } private IEnumerator DelaySettingObjectAway() { yield return (object)new WaitForSeconds(5f); base.targetFloorPosition = new Vector3(3000f, -400f, 3000f); base.startFallingPosition = new Vector3(3000f, -400f, 3000f); } public override void PlayDropSFX() { if (!base.deactivated) { ((GrabbableObject)this).PlayDropSFX(); } } [ServerRpc(RequireOwnership = false)] private void StartExplosionServerRpc(bool delay, float delayTime, int heldPlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) 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(619446056u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref delay, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref delayTime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, heldPlayerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 619446056u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { StartExplosionClientRpc(delay, delayTime, heldPlayerID); } } } [ClientRpc] private void StartExplosionClientRpc(bool delay, float delayTime, int heldPlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) 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(4234394122u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref delay, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref delayTime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, heldPlayerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4234394122u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && heldPlayerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { Logger.LogDebug((object)$"non-owner client starting GoldenGuardian #{((NetworkBehaviour)this).NetworkObjectId} explosion"); StartExplosion(delay, delayTime); } } } public static bool PatchToPreventDamage(PlayerControllerB __instance, bool isKillCommand) { if (!((NetworkBehaviour)__instance).IsOwner || __instance.isPlayerDead || !__instance.AllowPlayerDeath() || (Object)(object)__instance.currentlyHeldObjectServer == (Object)null) { return true; } GoldenGuardianScript component = ((Component)__instance.currentlyHeldObjectServer).GetComponent<GoldenGuardianScript>(); if ((Object)(object)component != (Object)null && !((GrabbableObject)component).deactivated && (isKillCommand || !component.aboutToExplode)) { Logger.LogDebug((object)$"GoldenGuardianScript patch: local player likely holding GoldenGuardian on server, trying to execute explosion | isKillCommand = {isKillCommand}"); bool delay = !isKillCommand && Config.hostToolRebalance; component.LocalPlayerStartExplosion(delay, isKillCommand); return false; } return true; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_GoldenGuardianScript() { //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(619446056u, new RpcReceiveHandler(__rpc_handler_619446056)); NetworkManager.__rpc_func_table.Add(4234394122u, new RpcReceiveHandler(__rpc_handler_4234394122)); } private static void __rpc_handler_619446056(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_004a: 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_0059: 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) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool delay = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref delay, default(ForPrimitives)); float delayTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref delayTime, default(ForPrimitives)); int heldPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref heldPlayerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenGuardianScript)(object)target).StartExplosionServerRpc(delay, delayTime, heldPlayerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4234394122(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_004a: 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_0059: 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) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool delay = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref delay, default(ForPrimitives)); float delayTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref delayTime, default(ForPrimitives)); int heldPlayerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref heldPlayerID); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldenGuardianScript)(object)target).StartExplosionClientRpc(delay, delayTime, heldPlayerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldenGuardianScript"; } } public class GoldkeeperScript : GrabbableObject { private static ManualLogSource Logger = Plugin.Logger; [Space(3f)] [Header("Blockers")] public Collider losBlocker; public NavMeshObstacle navBlocker; private Coroutine checkDistanceCoroutine; public override void Start() { ((GrabbableObject)this).Start(); navBlocker.carveOnlyStationary = true; } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (checkDistanceCoroutine != null) { Logger.LogDebug((object)"stopped CheckDistance Coroutine"); ((MonoBehaviour)this).StopCoroutine(checkDistanceCoroutine); checkDistanceCoroutine = null; } losBlocker.enabled = false; navBlocker.carving = false; ((Behaviour)navBlocker).enabled = false; LogEnabled(); } public override void PlayDropSFX() { ((GrabbableObject)this).PlayDropSFX(); if (checkDistanceCoroutine != null) { Logger.LogDebug((object)"stopped CheckDistance Coroutine"); ((MonoBehaviour)this).StopCoroutine(checkDistanceCoroutine); checkDistanceCoroutine = null; } checkDistanceCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckDistance()); } private IEnumerator CheckDistance() { bool playerInRange = true; bool setTo = true; PlayerControllerB player = StartOfRound.Instance.localPlayerController; while (playerInRange) { yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)((Component)this).GetComponentInParent<VehicleController>() != (Object)null || (Object)(object)((Component)this).GetComponentInParent<MineshaftElevatorController>() != (Object)null) { setTo = false; Logger.LogDebug((object)$"WARNING!!! {((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} dropped inside vehicle or elevator! breaking and setting collision enabled to {setTo}"); break; } if ((Object)(object)player == (Object)null || !player.isPlayerControlled) { playerInRange = false; } if (Vector3.Distance(((Component)this).transform.position - Vector3.back * 0.15f, ((Component)player).transform.position) >= 0.65f) { playerInRange = false; } } checkDistanceCoroutine = null; losBlocker.enabled = setTo; navBlocker.carving = setTo; ((Behaviour)navBlocker).enabled = setTo; LogEnabled(); } private void LogEnabled() { Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}: {((Object)((Component)losBlocker).gameObject).name} enabled = {losBlocker.enabled}"); } [ServerRpc(RequireOwnership = false)] public void SyncUponJoinServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(688314264u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 688314264u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncUponJoinClientRpc((Object)(object)base.playerHeldBy == (Object)null, playerID); } } } [ClientRpc] private void SyncUponJoinClientRpc(bool hostNullHeld, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) 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(4258008049u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostNullHeld, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4258008049u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId) { losBlocker.enabled = hostNullHeld; navBlocker.carving = hostNullHeld; ((Behaviour)navBlocker).enabled = hostNullHeld; if (!hostNullHeld) { Logger.LogDebug((object)$"custom injecting hasHitGround on {((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} since likely held on host"); base.hasHitGround = false; } LogEnabled(); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_GoldkeeperScript() { //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(688314264u, new RpcReceiveHandler(__rpc_handler_688314264)); NetworkManager.__rpc_func_table.Add(4258008049u, new RpcReceiveHandler(__rpc_handler_4258008049)); } private static void __rpc_handler_688314264(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldkeeperScript)(object)target).SyncUponJoinServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4258008049(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hostNullHeld = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostNullHeld, default(ForPrimitives)); int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)2; ((GoldkeeperScript)(object)target).SyncUponJoinClientRpc(hostNullHeld, playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldkeeperScript"; } } public class GoldmineScript : GrabbableObject { private static ManualLogSource Logger = Plugin.Logger; [Space(3f)] [Header("Functionality")] public GoldmineTrigger trigger; public bool hasExploded; public bool activated; public bool willExplodeImmediately; public bool willExplodeOnDelay; private float timeAtLastLightToggle; [Space(3f)] [Header("Audiovisual")] public AudioSource audioSource; public AudioClip triggerClip; public AudioClip beepClip; public AudioClip onClip; public AudioClip offClip; public Light triggerLight; public override void Start() { ((GrabbableObject)this).Start(); ((Behaviour)triggerLight).enabled = false; int num = (Config.hostToolRebalance ? 67 : 33); if (((NetworkBehaviour)this).IsServer && !base.isInShipRoom && Random.Range(1, 101) < num) { ToggleActiveClientRpc(hostActivated: true); } } public override void Update() { ((GrabbableObject)this).Update(); if (hasExploded) { return; } if (willExplodeOnDelay && (double)(Time.realtimeSinceStartup - timeAtLastLightToggle) > 0.075) { ToggleLight(); } if (activated) { if (Time.realtimeSinceStartup - timeAtLastLightToggle > 5f) { audioSource.PlayOneShot(beepClip); ToggleLight(); } if (((Behaviour)triggerLight).enabled && Time.realtimeSinceStartup - timeAtLastLightToggle > 0.1f) { ToggleLight(); } } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (StartOfRound.Instance.shipDoorsEnabled && !StartOfRound.Instance.inShipPhase) { ImmediateExplosionServerRpc((int)base.playerHeldBy.playerClientId); } } [ServerRpc(RequireOwnership = false)] private void ImmediateExplosionServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(3185693378u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3185693378u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ImmediateExplosionClientRpc(playerID); } } } [ClientRpc] private void ImmediateExplosionClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (net
plugins/Luigi Doll Scrap.dll
Decompiled 4 days agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using LethalLib.Modules; using Microsoft.CodeAnalysis; using UnityEngine; [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("Luigi Doll Scrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Luigi Doll Scrap")] [assembly: AssemblyTitle("Luigi Doll Scrap")] [assembly: AssemblyVersion("1.0.0.0")] 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 Luigi_Doll_Scrap { [BepInPlugin("shadow.LuigiDollScrap", "Luigi Doll", "1.1.2")] public class Plugins : BaseUnityPlugin { private const string GUID = "shadow.LuigiDollScrap"; private const string NAME = "Luigi Doll"; private const string VERSION = "1.1.2"; public static Plugins instance; private void Awake() { instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "luigidollscrapitem"); AssetBundle val = AssetBundle.LoadFromFile(text); Item val2 = val.LoadAsset<Item>("Assets/Luigi Doll Item.asset"); NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); Items.RegisterScrap(val2, 50, (LevelTypes)(-1)); Items.RemoveScrapFromLevels(val2, (LevelTypes)8, (string[])null); Items.RemoveScrapFromLevels(val2, (LevelTypes)16, (string[])null); Items.RemoveScrapFromLevels(val2, (LevelTypes)4, (string[])null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded Luigi Doll"); } } }
plugins/TerrasScrap.dll
Decompiled 4 days agousing System; 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 HarmonyLib; using LethalLevelLoader; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("TerrasScrap")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A small collection of vanilla styled scrap.")] [assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyInformationalVersion("1.0.2+e01cea7a61e58729b4695f7a34df66cf1ac416f8")] [assembly: AssemblyProduct("TerrasScrap")] [assembly: AssemblyTitle("Terra's Scrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TerrasScrap { [BepInPlugin("terraformer9x.TerrasScrap", "Terra's Scrap", "1.0.2")] public class Plugin : BaseUnityPlugin { private const string pluginGUID = "terraformer9x.TerrasScrap"; private const string pluginName = "Terra's Scrap"; private const string pluginVersion = "1.0.2"; private readonly Harmony harmony = new Harmony("terraformer9x.TerrasScrap"); public static Plugin Instance; private void Awake() { if (Instance == null) { Instance = this; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Terra's Scrap 1.0.2 is loaded!"); harmony.PatchAll(typeof(StartOfRoundPatch)); } public static void Log(string msg) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)msg); } public static void LogError(string msg) { ((BaseUnityPlugin)Instance).Logger.LogError((object)msg); } public static void LogDebug(string msg) { ((BaseUnityPlugin)Instance).Logger.LogDebug((object)msg); } } internal class StartOfRoundPatch { private static bool executed; [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPostfix] private static void StartOfRoundPostfix(ref StartOfRound __instance) { if (executed) { return; } executed = true; Dictionary<string, List<ItemGroup>> dictionary = new Dictionary<string, List<ItemGroup>>(); ItemGroup[] array = Resources.FindObjectsOfTypeAll<ItemGroup>(); foreach (ItemGroup val in array) { if (!dictionary.ContainsKey(((Object)val).name)) { List<ItemGroup> value = new List<ItemGroup>(1) { val }; dictionary.Add(((Object)val).name, value); } else { dictionary[((Object)val).name].Add(val); } } List<ExtendedItem> list = PatchedContent.ExtendedItems.Where((ExtendedItem x) => ((ExtendedContent)x).ModName == "Terra's Scrap").ToList(); Dictionary<string, Item> dictionary2 = new Dictionary<string, Item>(); foreach (ExtendedItem item in list) { if ((Object)(object)item.Item != (Object)null && !dictionary2.ContainsKey(((Object)item.Item).name) && !dictionary2.ContainsValue(item.Item)) { dictionary2.Add(((Object)item.Item).name, item.Item); } } dictionary2["TrafficCone"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]); dictionary2["Tuba"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]); dictionary2["WineBottle"].spawnPositionTypes.AddRange(dictionary["TabletopItems"]); dictionary2["Fan"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]); dictionary2["Fan"].spawnPositionTypes.AddRange(dictionary["TabletopItems"]); } } public static class PluginInfo { public const string PLUGIN_GUID = "TerrasScrap"; public const string PLUGIN_NAME = "TerrasScrap"; public const string PLUGIN_VERSION = "1.0.2"; } }