Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of LethalBoomba v1.0.1
BepInEx/plugins/LethalBommba.dll
Decompiled 13 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalBommba.NetcodePatcher; using LethalBoomba.Behaviors; using Microsoft.CodeAnalysis; using Unity.Netcode; 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("LethalBommba")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("zhiyan114 © MIT License")] [assembly: AssemblyDescription("Explosion Item")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0fc8e4d232bad6d4fe89aa7ef8a2c422a905197f")] [assembly: AssemblyProduct("LethalBommba")] [assembly: AssemblyTitle("LethalBommba")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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 LethalBoomba { [BepInPlugin("FurryNet.BoomBa", "BoomBa", "1.0.0")] public class Init : BaseUnityPlugin { public const string Guid = "FurryNet.BoomBa"; public const string Name = "BoomBa"; public const string Version = "1.0.0"; public static readonly ManualLogSource logger = Logger.CreateLogSource("FurryNet.BoomBa"); private static readonly Harmony harmony = new Harmony("FurryNet.BoomBa"); private void Awake() { ItemManager.InitFirst(); ItemManager.AddItem<BoomBaBehavior>("Assets/AssetBundles/BombToolkit/BoomBa/B00mbaProp.asset", 60); ItemManager.AddItem<NuKaBehavior>("Assets/AssetBundles/BombToolkit/NukeKa/NuKaProp.asset", 30); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } logger.LogDebug((object)"Called RuntimeInit on internal..."); harmony.PatchAll(typeof(RoundPatch)); harmony.PatchAll(typeof(NetworkHook)); logger.LogInfo((object)"RoundPatch Done..."); } } [HarmonyPatch(typeof(StartOfRound))] public class RoundPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(StartOfRound __instance) { ItemManager.SetupItemSpawn(__instance); } } [HarmonyPatch(typeof(GameNetworkManager))] public class NetworkHook { [HarmonyPatch("Start")] [HarmonyPostfix] public static void NetStart(GameNetworkManager __instance) { ItemManager.SetupNetPrefab(((Component)__instance).GetComponent<NetworkManager>()); } } public class ItemManager { private static Dictionary<string, ItemManager> _items; private static bool ItemConfigured; public static AssetBundle bundle { get; private set; } public static GameObject LargeExplosion { get; private set; } public static ItemManager[] items => _items.Values.ToArray(); public Item item { get; private set; } public int SpawnRate { get; private set; } private ItemManager() { } public static void AddItem(string assetPath, int spawnRate) { Item val = bundle.LoadAsset<Item>(assetPath); if ((Object)(object)val == (Object)null) { throw new Exception("Invalid asset bundle path: " + assetPath + "!"); } _items.Add(val.itemName, new ItemManager { item = val, SpawnRate = spawnRate }); Init.logger.LogInfo((object)("ItemManager: Added item " + val.itemName + " without custom behavior!")); } public static void AddItem<T>(string assetPath, int spawnRate) where T : GrabbableObject { Item val = bundle.LoadAsset<Item>(assetPath); _items.Add(val.itemName, new ItemManager { item = val, SpawnRate = spawnRate }); val.spawnPrefab.AddComponent<T>(); Init.logger.LogInfo((object)("ItemManager: Added item " + val.itemName + " with custom behavior!")); } public static Item? GetItem(string itemName) { return _items.GetValueOrDefault(itemName)?.item; } public static void InitFirst() { string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "bombpack"); if (!File.Exists(text)) { throw new Exception("bombpack asset missing!"); } _items = new Dictionary<string, ItemManager>(); bundle = AssetBundle.LoadFromFile(text); LargeExplosion = bundle.LoadAsset<GameObject>("Assets/AssetBundles/BombToolkit/NukeKa/Effect/NuKaBoomEffect.prefab"); Init.logger.LogInfo((object)"ItemManager: Successfully Loaded Bundle..."); } public static void SetupNetPrefab(NetworkManager netManager) { foreach (ItemManager value in _items.Values) { netManager.AddNetworkPrefab(value.item.spawnPrefab); } Init.logger.LogInfo((object)"ItemManager: Configured Network Prefabs"); } public static void SetupItemSpawn(StartOfRound instance) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (ItemConfigured) { return; } ItemConfigured = true; foreach (ItemManager value in _items.Values) { instance.allItemsList.itemsList.Add(value.item); SelectableLevel[] levels = instance.levels; for (int i = 0; i < levels.Length; i++) { levels[i].spawnableScrap.Add(new SpawnableItemWithRarity(value.item, value.SpawnRate)); } } Init.logger.LogInfo((object)"ItemManager: Successfully Loaded all items to all maps"); } } public static class Utils { public static void Explode(Vector3 position, float killRadius, int damage = 999, float force = 10f) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsClient) { return; } Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, position, Quaternion.Euler(-90f, 0f, 0f), RoundManager.Instance.mapPropsContainer.transform).SetActive(true); Collider[] array = Physics.OverlapSphere(position, killRadius, LayerMask.GetMask(new string[2] { "Player", "Enemies" })); foreach (Collider obj in array) { PlayerControllerB componentInParent = ((Component)obj).GetComponentInParent<PlayerControllerB>(); if ((Object)(object)componentInParent != (Object)null) { float num = Vector3.Distance(((Component)componentInParent).transform.position, position); Vector3 val = ((Component)componentInParent).transform.position - position; Vector3 val2 = ((Vector3)(ref val)).normalized * (force / Mathf.Max(num, 0.1f)); if (num <= killRadius) { val = default(Vector3); componentInParent.KillPlayer(val2, true, (CauseOfDeath)3, 0, val, false); } } EnemyAI componentInParent2 = ((Component)obj).GetComponentInParent<EnemyAI>(); if ((Object)(object)componentInParent2 != (Object)null && Vector3.Distance(((Component)componentInParent2).transform.position, position) <= killRadius) { componentInParent2.KillEnemyServerRpc(componentInParent2.enemyType.destroyOnDeath || !componentInParent2.enemyType.canDie); } } if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, position); HUDManager.Instance.ShakeCamera((ScreenShakeType)((num2 < killRadius) ? 1 : 0)); } } public static void HideNetObject(GameObject obj) { Renderer val = default(Renderer); if (obj.TryGetComponent<Renderer>(ref val)) { val.enabled = false; } Collider val2 = default(Collider); if (obj.TryGetComponent<Collider>(ref val2)) { val2.enabled = false; } } } } namespace LethalBoomba.Behaviors { public class BoomBaBehavior : GrabbableObject { public AudioClip preExplodeSound; public float countdownSec; public AudioClip preExplodeFinalSound; public float preExplodeFinalCD; private AudioSource BombSrc; private float blastRadius = 5f; private NetworkVariable<bool> isDetonated = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public AnimationCurve grenadeFallCurve; public AnimationCurve grenadeVerticalFallCurve; public AnimationCurve grenadeVerticalFallCurveNoBounce; private int grenadeThrowMask = 268437761; private void Awake() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown BombSrc = ((Component)this).GetComponent<AudioSource>(); base.grabbable = true; base.isInFactory = true; base.itemProperties = ItemManager.GetItem("B00mba"); countdownSec = 5f; preExplodeFinalCD = 3.5f; preExplodeSound = ItemManager.bundle.LoadAsset<AudioClip>("Assets/AssetBundles/BombToolkit/BoomBa/Sounds/BoomBaCountdown.ogg"); preExplodeFinalSound = ItemManager.bundle.LoadAsset<AudioClip>("Assets/AssetBundles/BombToolkit/BoomBa/Sounds/B00mbaBoom.ogg"); grenadeFallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); grenadeVerticalFallCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f, 0f, 0f), new Keyframe(0.35f, -0.35f, 0f, 0f), new Keyframe(1f, 1f, 0f, 0f) }); grenadeVerticalFallCurveNoBounce = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f, 0f, 0f), new Keyframe(0.4f, -0.2f, 0f, 0f), new Keyframe(1f, 1f, 0f, 0f) }); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (buttonDown) { if (!isDetonated.Value) { StartBoomServerRpc(); } else if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(), true); } } } public override void SetControlTipsForItem() { HUDManager.Instance.ChangeControlTipMultiple(new string[1] { isDetonated.Value ? "Throw Bomb : [LMB]" : "Detonate Bomb : [LMB]" }, true, base.itemProperties); } [Rpc(/*Could not decode attribute arguments.*/)] private void StartBoomServerRpc(RpcParams rpcParam = default(RpcParams)) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(700783189u, rpcParam, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 700783189u, rpcParam, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isDetonated.Value) { isDetonated.Value = true; ((MonoBehaviour)this).StartCoroutine(ManagedExecution()); } } } private IEnumerator ManagedExecution() { if (NetworkManager.Singleton.IsServer) { ExecuteStageClientRpc(); yield return (object)new WaitForSeconds(countdownSec + preExplodeFinalCD + 3f); ((Component)this).GetComponent<NetworkObject>().Despawn(true); } } private IEnumerator CountdownRoutine() { if (!NetworkManager.Singleton.IsClient) { yield break; } if (!StartOfRound.Instance.shipHasLanded) { if (((NetworkBehaviour)this).IsOwner) { PlayerControllerB playerHeldBy = base.playerHeldBy; if (playerHeldBy != null) { playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } base.grabbable = false; } BombSrc.PlayOneShot(preExplodeSound); yield return (object)new WaitForSeconds(countdownSec); BombSrc.PlayOneShot(preExplodeFinalSound); yield return (object)new WaitForSeconds(preExplodeFinalCD); Utils.Explode(((Component)this).GetComponent<Transform>().position, blastRadius); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); Utils.HideNetObject(((Component)this).gameObject); } [Rpc(/*Could not decode attribute arguments.*/)] private void ExecuteStageClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(41736811u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 41736811u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(CountdownRoutine()); } } } private Vector3 GetGrenadeThrowDestination() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) Camera gameplayCamera = base.playerHeldBy.gameplayCamera; Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)gameplayCamera).transform.position, ((Component)gameplayCamera).transform.forward); RaycastHit val3 = default(RaycastHit); Vector3 val2 = ((!Physics.Raycast(val, ref val3, 12f, grenadeThrowMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref val)).GetPoint(10f) : ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val3)).distance - 0.05f)); ((Ray)(ref val))..ctor(val2, Vector3.down); if (Physics.Raycast(val, ref val3, 30f, grenadeThrowMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val3)).point + Vector3.up * (base.itemProperties.verticalOffset + 0.05f); } return ((Ray)(ref val)).GetPoint(30f); } 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 = base.startFallingPosition - base.targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(base.startFallingPosition, base.targetFloorPosition, grenadeFallCurve.Evaluate(base.fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, base.startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, base.targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurveNoBounce.Evaluate(base.fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, base.startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, base.targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurve.Evaluate(base.fallTime)); } base.fallTime += Mathf.Abs(Time.deltaTime * 12f / magnitude); } protected override void __initializeVariables() { if (isDetonated == null) { throw new Exception("BoomBaBehavior.isDetonated cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isDetonated).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isDetonated, "isDetonated"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isDetonated); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(700783189u, new RpcReceiveHandler(__rpc_handler_700783189), "StartBoomServerRpc"); ((NetworkBehaviour)this).__registerRpc(41736811u, new RpcReceiveHandler(__rpc_handler_41736811), "ExecuteStageClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_700783189(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_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((BoomBaBehavior)(object)target).StartBoomServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_41736811(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; ((BoomBaBehavior)(object)target).ExecuteStageClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BoomBaBehavior"; } } public class NuKaBehavior : GrabbableObject { public AudioClip preExplodeSound; public float countdownSec; public float beforeKillcdSec; private AudioSource BombSrc; private AudioSource GlobalExplode; private float blastRadius = 5f; private NetworkVariable<bool> isDetonated = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private void Awake() { BombSrc = ((Component)this).GetComponents<AudioSource>()[1]; base.grabbable = true; base.isInFactory = true; base.itemProperties = ItemManager.GetItem("NuKa"); countdownSec = 7.5f; beforeKillcdSec = 1f; preExplodeSound = ItemManager.bundle.LoadAsset<AudioClip>("Assets/AssetBundles/BombToolkit/NukeKa/Sounds/NuKaBoom.ogg"); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (buttonDown && !isDetonated.Value) { StartBoomServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void StartBoomServerRpc(RpcParams rpcParam = default(RpcParams)) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4197946983u, rpcParam, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4197946983u, rpcParam, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isDetonated.Value) { isDetonated.Value = true; ((MonoBehaviour)this).StartCoroutine(ManagedExecution()); } } } private IEnumerator ManagedExecution() { if (NetworkManager.Singleton.IsServer) { ExecuteStageClientRpc(); yield return (object)new WaitForSeconds(countdownSec + beforeKillcdSec + 1f); ((Component)this).GetComponent<NetworkObject>().Despawn(true); } } private IEnumerator CountdownRoutine() { if (NetworkManager.Singleton.IsClient) { BombSrc.PlayOneShot(preExplodeSound); yield return (object)new WaitForSeconds(countdownSec); Object.Instantiate<GameObject>(ItemManager.LargeExplosion, ((Component)this).GetComponent<Transform>().position, Quaternion.Euler(-90f, 0f, 0f), RoundManager.Instance.mapPropsContainer.transform).SetActive(true); HUDManager.Instance.ShakeCamera((ScreenShakeType)3); yield return (object)new WaitForSeconds(beforeKillcdSec); GameNetworkManager.Instance.localPlayerController.KillPlayer(Vector3.zero, true, (CauseOfDeath)3, 0, default(Vector3), false); Utils.HideNetObject(((Component)this).gameObject); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExecuteStageClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(107613353u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 107613353u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(CountdownRoutine()); } } } protected override void __initializeVariables() { if (isDetonated == null) { throw new Exception("NuKaBehavior.isDetonated cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isDetonated).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isDetonated, "isDetonated"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isDetonated); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4197946983u, new RpcReceiveHandler(__rpc_handler_4197946983), "StartBoomServerRpc"); ((NetworkBehaviour)this).__registerRpc(107613353u, new RpcReceiveHandler(__rpc_handler_107613353), "ExecuteStageClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4197946983(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_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((NuKaBehavior)(object)target).StartBoomServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_107613353(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; ((NuKaBehavior)(object)target).ExecuteStageClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NuKaBehavior"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); } } } namespace LethalBommba.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }