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 KarmaOne v1.0.0
KarmaOne.dll
Decompiled 9 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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 HarmonyLib; using KarmaOne.Behaviours; using KarmaOne.NetcodePatcher; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [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("KarmaOne")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("KarmaOne")] [assembly: AssemblyTitle("KarmaOne")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace KarmaOne { public static class KarmaConfig { public static ConfigEntry<bool> Purchasable { get; private set; } public static ConfigEntry<int> Price { get; private set; } public static ConfigEntry<bool> SpawnAsScrap { get; private set; } public static ConfigEntry<int> ScrapSpawnWeight { get; private set; } public static ConfigEntry<float> ItemWeight { get; private set; } public static ConfigEntry<int> Damage { get; private set; } public static ConfigEntry<int> UsesPerCharge { get; private set; } public static ConfigEntry<float> ShotCooldown { get; private set; } public static ConfigEntry<float> ChargeTime { get; private set; } public static ConfigEntry<float> FireWindow { get; private set; } public static ConfigEntry<bool> OverchargeEnabled { get; private set; } public static ConfigEntry<int> MisfireChance { get; private set; } internal static void Init(ConfigFile cfg) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown Purchasable = cfg.Bind<bool>("Shop", "Purchasable", true, "If true, the Karma-1 appears in the terminal shop."); Price = cfg.Bind<int>("Shop", "Price", 700, new ConfigDescription("Shop price in credits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>())); SpawnAsScrap = cfg.Bind<bool>("Scrap", "SpawnAsScrap", false, "If true, the Karma-1 can appear as world scrap on moons."); ScrapSpawnWeight = cfg.Bind<int>("Scrap", "ScrapSpawnWeight", 10, new ConfigDescription("Spawn weight when SpawnAsScrap is true. Higher = more common. Vanilla reference: ~10 rare, ~30 uncommon, ~60 common.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 999), Array.Empty<object>())); ItemWeight = cfg.Bind<float>("Item", "ItemWeight", 1.5f, new ConfigDescription("Weight of the Karma-1 in kg. Vanilla reference: shovel = 5.2kg, shotgun = 5.4kg, flashlight = 0.5kg. This value is added on top of the base 1kg all items have in LC's weight system.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 50f), Array.Empty<object>())); Damage = cfg.Bind<int>("Combat", "Damage", 100, new ConfigDescription("Damage dealt per shot to players and enemies. Players have 100 HP by default, so 100 is a one-shot.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>())); UsesPerCharge = cfg.Bind<int>("Combat", "UsesPerCharge", 2, new ConfigDescription("Number of full shots available per battery charge.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); ShotCooldown = cfg.Bind<float>("Combat", "ShotCooldown", 5f, new ConfigDescription("Seconds the gun must cool down after firing.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 60f), Array.Empty<object>())); ChargeTime = cfg.Bind<float>("Charging", "ChargeTime", 2f, new ConfigDescription("Seconds of holding [Use] before the scope turns green and the gun enters the fire window.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); FireWindow = cfg.Bind<float>("Charging", "FireWindow", 0.9f, new ConfigDescription("Seconds the gun stays in the green fire window after reaching ChargeTime. Only relevant when OverchargeEnabled = true.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); OverchargeEnabled = cfg.Bind<bool>("Overcharge", "OverchargeEnabled", true, "If true, holding past the fire window causes an overcharge explosion damaging the holder. If false, the gun stays in the fire window indefinitely with no penalty."); MisfireChance = cfg.Bind<int>("Combat", "MisfireChance", 5, new ConfigDescription("1-in-N chance the gun fires when dropped (if it has charge and isn't cooling down). Set to 0 to disable drop misfires entirely. Default is 1-in-5. Vanilla shotgun uses 1-in-20.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), Array.Empty<object>())); } } [BepInPlugin("karmaone.karma1", "KarmaOne", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string ModGUID = "karmaone.karma1"; public const string ModName = "KarmaOne"; public const string ModVersion = "1.0.0"; internal static ManualLogSource Log; private readonly Harmony harmony = new Harmony("karmaone.karma1"); private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"KarmaOne 1.0.0 loading..."); KarmaConfig.Init(((BaseUnityPlugin)this).Config); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "moreitems")); if ((Object)(object)val == (Object)null) { Log.LogError((object)"Failed to load asset bundle 'moreitems'. Make sure the 'moreitems' file is next to KarmaOne.dll."); return; } Item val2 = val.LoadAsset<Item>("Assets/Karma/KarmaItem.asset"); if ((Object)(object)val2 == (Object)null) { Log.LogError((object)"KarmaItem.asset not found in bundle."); return; } GameObject spawnPrefab = val2.spawnPrefab; if ((Object)(object)spawnPrefab == (Object)null) { Log.LogError((object)"KarmaItem.asset has no spawnPrefab."); return; } if ((Object)(object)spawnPrefab.GetComponent<KarmaBehaviour>() == (Object)null) { spawnPrefab.AddComponent<KarmaBehaviour>(); } Utilities.FixMixerGroups(spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(spawnPrefab); if (KarmaConfig.Purchasable.Value) { TerminalNode val3 = val.LoadAsset<TerminalNode>("Assets/Karma/KarmaTerminalNode.asset"); Items.RegisterShopItem(val2, (TerminalNode)null, (TerminalNode)null, val3, KarmaConfig.Price.Value); Log.LogInfo((object)$"Karma-1 registered in shop for {KarmaConfig.Price.Value} credits."); } if (KarmaConfig.SpawnAsScrap.Value) { Items.RegisterScrap(val2, KarmaConfig.ScrapSpawnWeight.Value, (LevelTypes)(-1)); Log.LogInfo((object)$"Karma-1 registered as scrap (weight {KarmaConfig.ScrapSpawnWeight.Value})."); } if (!KarmaConfig.Purchasable.Value && !KarmaConfig.SpawnAsScrap.Value) { Log.LogWarning((object)"Karma-1: both Purchasable and SpawnAsScrap are disabled — the item will not appear in game."); } harmony.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)"KarmaOne loaded successfully."); } } public static class PluginInfo { public const string PLUGIN_GUID = "KarmaOne"; public const string PLUGIN_NAME = "KarmaOne"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace KarmaOne.Behaviours { public class KarmaBehaviour : GrabbableObject { private readonly string[] sources = new string[8] { "ChargeSFX", "ShootSFX", "TrailSFX", "WarningSFX", "ExplosionSFX", "CooldownSFX", "CoolupSFX", "OnCdShotSFX" }; private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>(); private readonly string[] ps = new string[4] { "MuzzleFlash", "Trail", "LingeringFire", "MainBlast" }; private Dictionary<string, ParticleSystem> psDict = new Dictionary<string, ParticleSystem>(); private Color readyColor = Color32.op_Implicit(new Color32((byte)20, (byte)20, (byte)20, byte.MaxValue)); private Color shootColor = Color32.op_Implicit(new Color32((byte)20, (byte)200, (byte)20, byte.MaxValue)); private Color dangerColor = Color32.op_Implicit(new Color32((byte)200, (byte)20, (byte)20, byte.MaxValue)); private Color unreadyColor = Color32.op_Implicit(new Color32((byte)250, (byte)100, (byte)0, byte.MaxValue)); private bool coolingDown; private bool broken; private bool charging; private bool activated; private bool shotFired; private bool startedRegen; private bool laserToggled; private float cooldown = 5f; private float timeSinceShot; private float maxChargeBeforeShooting = 2f; private float maxChargeBeforeExplode = 2.9f; private float chargeTime; private float energyLostPerShot = 0.5f; private int interval = 10; private GameObject? ScopeChargeTimer; private GameObject? laserLight; private const float TrailSpeed = 80f; private const float TrailSize = 0.18f; private const float TrailLife = 0.25f; public override void Start() { ((GrabbableObject)this).Start(); base.grabbable = true; base.grabbableToEnemies = true; base.itemProperties.weight = 1f + KarmaConfig.ItemWeight.Value / 100f; sourcesDict = GetAllAudioSources(((Component)this).gameObject, "KarmaSFX", sources); psDict = GetAllParticleSystems(((Component)this).gameObject, "KarmaParticles", ps); Transform obj = ((Component)this).gameObject.transform.Find("ScopeChargeTimer"); ScopeChargeTimer = ((obj != null) ? ((Component)obj).gameObject : null); Transform obj2 = ((Component)this).gameObject.transform.Find("laserLight"); laserLight = ((obj2 != null) ? ((Component)obj2).gameObject : null); if (IsLocalPlayerHosting()) { base.insertedBattery.charge = 1f; } energyLostPerShot = 1f / (float)Mathf.Max(1, KarmaConfig.UsesPerCharge.Value); cooldown = KarmaConfig.ShotCooldown.Value; maxChargeBeforeShooting = KarmaConfig.ChargeTime.Value; maxChargeBeforeExplode = KarmaConfig.ChargeTime.Value + KarmaConfig.FireWindow.Value; TuneTrailParticle(); AppendTooltip("Toggle laser: [Q]"); } private void AppendTooltip(string text) { if ((Object)(object)base.itemProperties == (Object)null) { return; } string[] array = base.itemProperties.toolTips ?? new string[0]; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { if (array2[i] == text) { return; } } string[] array3 = new string[array.Length + 1]; array.CopyTo(array3, 0); array3[array.Length] = text; base.itemProperties.toolTips = array3; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (IsLocalPlayerHosting()) { SetCoolingDownClientRpc(coolingDown); SetBrokenClientRpc(broken); } if (!startedRegen) { startedRegen = true; ((MonoBehaviour)this).StartCoroutine(RegenBattery()); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); ResetOwnerState(); SetLaserActive(on: false); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); SetLaserActive(laserToggled); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); ResetOwnerState(); SetLaserActive(on: false); } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); ResetOwnerState(); if (!coolingDown && base.insertedBattery.charge > energyLostPerShot && !broken && IsLocalPlayerHosting() && KarmaConfig.MisfireChance.Value > 0 && Random.Range(1, KarmaConfig.MisfireChance.Value + 1) == 1) { ShootServerRpc(); } } public override void ItemActivate(bool used, bool buttonDown) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)base.playerHeldBy == (Object)null || base.isPocketed || !base.wasOwnerLastFrame || broken) { return; } if (buttonDown) { if (!coolingDown && base.insertedBattery.charge > energyLostPerShot) { activated = true; } else { PlaySafe("OnCdShotSFX"); } return; } activated = false; if (!shotFired && chargeTime < maxChargeBeforeShooting) { chargeTime = 0f; NotifyStopChargingServerRpc(wasShot: false); } } public override void ChargeBatteries() { ((GrabbableObject)this).ChargeBatteries(); RepairServerRpc(); } public override void Update() { //IL_0192: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); UpdateLaserAim(); if (IsLocalOwner() && !base.isPocketed && (Object)(object)base.playerHeldBy != (Object)null) { Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.qKey).wasPressedThisFrame) { laserToggled = !laserToggled; SetLaserActive(laserToggled); } } if (broken) { return; } if (coolingDown) { if ((base.wasOwnerLastFrame || IsLocalPlayerHosting()) && FrameCountTick()) { timeSinceShot += Time.deltaTime * (float)interval; if (timeSinceShot > cooldown) { ResetCooldownServerRpc(); } } } else { if (!base.wasOwnerLastFrame || !FrameCountTick()) { return; } if (activated) { NotifyStartChargingServerRpc(); chargeTime += Time.deltaTime * (float)interval; if (KarmaConfig.OverchargeEnabled.Value && chargeTime > maxChargeBeforeExplode) { chargeTime = 0f; activated = false; shotFired = false; if (charging) { NotifyStopChargingServerRpc(wasShot: false); } ExplodeServerRpc(); } else if (KarmaConfig.OverchargeEnabled.Value && chargeTime > maxChargeBeforeShooting && (Object)(object)ScopeChargeTimer != (Object)null && (chargeTime - maxChargeBeforeShooting) / (maxChargeBeforeExplode - maxChargeBeforeShooting) > 0.6f) { SetScopeColor(dangerColor); } } else { bool flag = ((!KarmaConfig.OverchargeEnabled.Value) ? (chargeTime >= maxChargeBeforeShooting) : (chargeTime >= maxChargeBeforeShooting && chargeTime <= maxChargeBeforeExplode)); if (flag && !shotFired) { shotFired = true; ShootServerRpc(); } else if (!flag && !shotFired) { chargeTime = 0f; NotifyStopChargingServerRpc(wasShot: false); } } } } private void ResetOwnerState() { activated = false; shotFired = false; chargeTime = 0f; if (charging) { NotifyStopChargingServerRpc(wasShot: false); } } private void UpdateLaserAim() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00c8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)laserLight == (Object)null) && !base.isPocketed && laserToggled) { Camera val = base.playerHeldBy?.gameplayCamera; if (!((Object)(object)val == (Object)null)) { int mask = LayerMask.GetMask(new string[4] { "Player", "Enemies", "Room", "Default" }); RaycastHit val2 = default(RaycastHit); Vector3 val3 = ((!Physics.Raycast(((Component)val).transform.position, ((Component)val).transform.forward, ref val2, 200f, mask)) ? (((Component)val).transform.position + ((Component)val).transform.forward * 200f) : ((RaycastHit)(ref val2)).point); laserLight.transform.LookAt(val3); } } } private void TuneTrailParticle() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (psDict.TryGetValue("Trail", out ParticleSystem value)) { MainModule main = value.main; ((MainModule)(ref main)).startSpeed = new MinMaxCurve(80f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.18f); ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.25f); } } private IEnumerator RegenBattery() { while (true) { yield return (object)new WaitForSeconds(30f); if (IsLocalPlayerHosting() && base.insertedBattery.charge < 1f) { base.insertedBattery.charge = Mathf.Min(base.insertedBattery.charge + 0.1f, 1f); } } } private bool FrameCountTick() { return Time.frameCount % interval == 0; } private static bool IsLocalPlayerHosting() { if ((Object)(object)NetworkManager.Singleton != (Object)null) { if (!NetworkManager.Singleton.IsHost) { return NetworkManager.Singleton.IsServer; } return true; } return false; } private bool IsLocalOwner() { if ((Object)(object)base.playerHeldBy != (Object)null) { return base.playerHeldBy.playerClientId == GameNetworkManager.Instance?.localPlayerController?.playerClientId; } return false; } private void SetLaserActive(bool on) { if ((Object)(object)laserLight != (Object)null) { laserLight.SetActive(on); } } private void SetScopeColor(Color c) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ScopeChargeTimer == (Object)null)) { Renderer component = ScopeChargeTimer.GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { component.material.color = c; } } } private void PlaySafe(string key) { if (sourcesDict.TryGetValue(key, out AudioSource value)) { value.Play(); } } private void PlayDelayedSafe(string key, float delay) { if (sourcesDict.TryGetValue(key, out AudioSource value)) { value.PlayDelayed(delay); } } private void StopSafe(string key) { if (sourcesDict.TryGetValue(key, out AudioSource value)) { value.Stop(); } } private void PlayParticleSafe(string key) { if (psDict.TryGetValue(key, out ParticleSystem value)) { value.Play(); } } private static Dictionary<string, AudioSource> GetAllAudioSources(GameObject root, string containerName, string[] keys) { Dictionary<string, AudioSource> dictionary = new Dictionary<string, AudioSource>(); Transform val = root.transform.Find(containerName); if ((Object)(object)val == (Object)null) { return dictionary; } foreach (string text in keys) { Transform val2 = val.Find(text); if (!((Object)(object)val2 == (Object)null)) { AudioSource component = ((Component)val2).GetComponent<AudioSource>(); if ((Object)(object)component != (Object)null) { dictionary[text] = component; } } } return dictionary; } private static Dictionary<string, ParticleSystem> GetAllParticleSystems(GameObject root, string containerName, string[] keys) { Dictionary<string, ParticleSystem> dictionary = new Dictionary<string, ParticleSystem>(); Transform val = root.transform.Find(containerName); if ((Object)(object)val == (Object)null) { return dictionary; } foreach (string text in keys) { Transform val2 = val.Find(text); if (!((Object)(object)val2 == (Object)null)) { ParticleSystem component = ((Component)val2).GetComponent<ParticleSystem>(); if ((Object)(object)component != (Object)null) { dictionary[text] = component; } } } return dictionary; } [ServerRpc(RequireOwnership = false)] public void ShootServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3057004730u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3057004730u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootClientRpc(); } } } [ClientRpc] public void ShootClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3959243505u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3959243505u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySafe("ShootSFX"); PlayDelayedSafe("TrailSFX", 0.1f); PlayParticleSafe("MuzzleFlash"); PlayParticleSafe("Trail"); if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { base.insertedBattery.charge = Mathf.Max(0f, base.insertedBattery.charge - energyLostPerShot); } PlayDelayedSafe("CooldownSFX", 0.35f); if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { SetCoolingDownClientRpc(value: true); } else { SetCoolingDownServerRpc(value: true); } SetScopeColor(unreadyColor); charging = false; chargeTime = 0f; shotFired = false; StopSafe("ChargeSFX"); if (IsLocalOwner()) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } if (!IsLocalOwner()) { return; } Camera val3 = base.playerHeldBy?.gameplayCamera; if ((Object)(object)val3 == (Object)null) { return; } Vector3 position = ((Component)val3).transform.position; Vector3 forward = ((Component)val3).transform.forward; int mask = LayerMask.GetMask(new string[3] { "Player", "Enemies", "Room" }); RaycastHit val4 = default(RaycastHit); if (!Physics.Raycast(position, forward, ref val4, float.PositiveInfinity, mask)) { return; } PlayerControllerB component = ((Component)((RaycastHit)(ref val4)).collider).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && (Object)(object)component != (Object)(object)base.playerHeldBy) { int value = KarmaConfig.Damage.Value; if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { component.DamagePlayer(value, true, true, (CauseOfDeath)7, 0, false, forward); } else { component.DamagePlayerFromOtherClientServerRpc(value, forward, (int)component.playerClientId); } } EnemyAI component2 = ((Component)((Component)((RaycastHit)(ref val4)).collider).transform.root).GetComponent<EnemyAI>(); if (component2 != null) { component2.HitEnemy(KarmaConfig.Damage.Value, base.playerHeldBy, true, -1); } } [ServerRpc(RequireOwnership = false)] public void NotifyStartChargingServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3173377209u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3173377209u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NotifyStartChargingClientRpc(); } } } [ClientRpc] public void NotifyStartChargingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4101819740u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4101819740u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!charging) { charging = true; PlaySafe("ChargeSFX"); } if (chargeTime > maxChargeBeforeShooting) { SetScopeColor(shootColor); } } } [ServerRpc(RequireOwnership = false)] public void NotifyStopChargingServerRpc(bool wasShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(390940820u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref wasShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 390940820u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NotifyStopChargingClientRpc(wasShot); } } } [ClientRpc] public void NotifyStopChargingClientRpc(bool wasShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2651812308u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref wasShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2651812308u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (charging) { charging = false; chargeTime = 0f; StopSafe("ChargeSFX"); if (!wasShot) { SetScopeColor(readyColor); } } } [ServerRpc(RequireOwnership = false)] public void ResetCooldownServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3562104048u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3562104048u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ResetCooldownClientRpc(); } } } [ClientRpc] public void ResetCooldownClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3702522798u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3702522798u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; timeSinceShot = 0f; if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { SetCoolingDownClientRpc(value: false); } else { SetCoolingDownServerRpc(value: false); } PlaySafe("CoolupSFX"); SetScopeColor(readyColor); } } [ServerRpc(RequireOwnership = false)] public void ExplodeServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2234755725u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2234755725u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExplodeClientRpc(); } } } [ClientRpc] public void ExplodeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3815608759u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3815608759u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayParticleSafe("LingeringFire"); PlayParticleSafe("MainBlast"); PlaySafe("ExplosionSFX"); charging = false; chargeTime = 0f; StopSafe("ChargeSFX"); SetScopeColor(readyColor); activated = false; shotFired = false; if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { base.insertedBattery.charge = 0f; } if ((Object)(object)base.playerHeldBy != (Object)null) { int value = KarmaConfig.Damage.Value; if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { base.playerHeldBy.DamagePlayer(value, true, true, (CauseOfDeath)3, 0, false, Vector3.up); } else if (IsLocalOwner()) { base.playerHeldBy.DamagePlayerFromOtherClientServerRpc(value, Vector3.up, (int)base.playerHeldBy.playerClientId); } } if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { SetCoolingDownClientRpc(value: true); } else { SetCoolingDownServerRpc(value: true); } } [ServerRpc(RequireOwnership = false)] public void RepairServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2374597506u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2374597506u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetBrokenServerRpc(value: false); RepairClientRpc(); } } } [ClientRpc] public void RepairClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1368960985u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1368960985u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetScopeColor(coolingDown ? unreadyColor : readyColor); } } } [ServerRpc(RequireOwnership = false)] public void SetCoolingDownServerRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1947983455u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1947983455u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetCoolingDownClientRpc(value); } } } [ClientRpc] public void SetCoolingDownClientRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1318879723u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1318879723u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; coolingDown = value; } } } [ServerRpc(RequireOwnership = false)] public void SetBrokenServerRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1759257859u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1759257859u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetBrokenClientRpc(value); } } } [ClientRpc] public void SetBrokenClientRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1854064234u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1854064234u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; broken = value; } } } protected override void __initializeVariables() { ((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 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3057004730u, new RpcReceiveHandler(__rpc_handler_3057004730), "ShootServerRpc"); ((NetworkBehaviour)this).__registerRpc(3959243505u, new RpcReceiveHandler(__rpc_handler_3959243505), "ShootClientRpc"); ((NetworkBehaviour)this).__registerRpc(3173377209u, new RpcReceiveHandler(__rpc_handler_3173377209), "NotifyStartChargingServerRpc"); ((NetworkBehaviour)this).__registerRpc(4101819740u, new RpcReceiveHandler(__rpc_handler_4101819740), "NotifyStartChargingClientRpc"); ((NetworkBehaviour)this).__registerRpc(390940820u, new RpcReceiveHandler(__rpc_handler_390940820), "NotifyStopChargingServerRpc"); ((NetworkBehaviour)this).__registerRpc(2651812308u, new RpcReceiveHandler(__rpc_handler_2651812308), "NotifyStopChargingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3562104048u, new RpcReceiveHandler(__rpc_handler_3562104048), "ResetCooldownServerRpc"); ((NetworkBehaviour)this).__registerRpc(3702522798u, new RpcReceiveHandler(__rpc_handler_3702522798), "ResetCooldownClientRpc"); ((NetworkBehaviour)this).__registerRpc(2234755725u, new RpcReceiveHandler(__rpc_handler_2234755725), "ExplodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3815608759u, new RpcReceiveHandler(__rpc_handler_3815608759), "ExplodeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2374597506u, new RpcReceiveHandler(__rpc_handler_2374597506), "RepairServerRpc"); ((NetworkBehaviour)this).__registerRpc(1368960985u, new RpcReceiveHandler(__rpc_handler_1368960985), "RepairClientRpc"); ((NetworkBehaviour)this).__registerRpc(1947983455u, new RpcReceiveHandler(__rpc_handler_1947983455), "SetCoolingDownServerRpc"); ((NetworkBehaviour)this).__registerRpc(1318879723u, new RpcReceiveHandler(__rpc_handler_1318879723), "SetCoolingDownClientRpc"); ((NetworkBehaviour)this).__registerRpc(1759257859u, new RpcReceiveHandler(__rpc_handler_1759257859), "SetBrokenServerRpc"); ((NetworkBehaviour)this).__registerRpc(1854064234u, new RpcReceiveHandler(__rpc_handler_1854064234), "SetBrokenClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3057004730(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; ((KarmaBehaviour)(object)target).ShootServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3959243505(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; ((KarmaBehaviour)(object)target).ShootClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3173377209(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; ((KarmaBehaviour)(object)target).NotifyStartChargingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4101819740(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; ((KarmaBehaviour)(object)target).NotifyStartChargingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_390940820(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 wasShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref wasShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).NotifyStopChargingServerRpc(wasShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2651812308(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 wasShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref wasShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).NotifyStopChargingClientRpc(wasShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3562104048(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; ((KarmaBehaviour)(object)target).ResetCooldownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3702522798(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; ((KarmaBehaviour)(object)target).ResetCooldownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2234755725(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; ((KarmaBehaviour)(object)target).ExplodeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3815608759(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; ((KarmaBehaviour)(object)target).ExplodeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2374597506(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; ((KarmaBehaviour)(object)target).RepairServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1368960985(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; ((KarmaBehaviour)(object)target).RepairClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1947983455(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 coolingDownServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref coolingDownServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).SetCoolingDownServerRpc(coolingDownServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1318879723(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 coolingDownClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref coolingDownClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).SetCoolingDownClientRpc(coolingDownClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1759257859(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 brokenServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref brokenServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).SetBrokenServerRpc(brokenServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1854064234(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 brokenClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref brokenClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KarmaBehaviour)(object)target).SetBrokenClientRpc(brokenClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "KarmaBehaviour"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace KarmaOne.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }