Decompiled source of GtfoEZAbsurdWeapons v17.0.0
GTFO.EZ.AbsurdWeapons.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using AK; using Agents; using AssetShards; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Enemies; using FX_EffectSystem; using Feedback; using GTFO.API; using GameData; using Gear; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections; using Il2CppSystem.Collections.Generic; using LevelGeneration; using Localization; using Microsoft.CodeAnalysis; using MindAttic.GTFO.Shared; using Player; using SNetwork; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("GTFO.EZ.AbsurdWeapons")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+803745d61632e31d44cee4a438ca93cde9de15d2")] [assembly: AssemblyProduct("GTFO.EZ.AbsurdWeapons")] [assembly: AssemblyTitle("GTFO.EZ.AbsurdWeapons")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] 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; } } [CompilerGenerated] [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 MindAttic.GTFO.Shared { internal static class SharedOwner { internal static readonly ManualLogSource Log = Logger.CreateLogSource("MindAttic.GTFO.Shared"); internal const string MasterSection = "0. Mod"; internal const string MasterKey = "Enabled"; private static readonly string[] Order = new string[4] { "MindAttic.GTFO.EZ", "MindAttic.GTFO.EZ.AbsurdWeapons", "MindAttic.GTFO.EZ.AbsurdMoves", "MindAttic.GTFO.EZ.AbsurdItems" }; private static bool? _isOwner; internal static bool IsOwner { get { bool valueOrDefault = _isOwner == true; if (!_isOwner.HasValue) { valueOrDefault = FindOwner(); _isOwner = valueOrDefault; return valueOrDefault; } return valueOrDefault; } } private static bool FindOwner() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string[] order = Order; for (int i = 0; i < order.Length; i++) { if (TryGetActive(order[i], out BasePlugin plugin)) { Assembly assembly = ((object)plugin).GetType().Assembly; if (!(assembly.GetType(typeof(SharedOwner).FullName) == null)) { return assembly == executingAssembly; } } } } catch (Exception ex) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(53, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Couldn't tell which GTFO.* mod runs the shared keys. "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } Log.LogWarning(val); } return false; } internal static bool IsActive(string guid) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown try { BasePlugin plugin; return TryGetActive(guid, out plugin); } catch (Exception ex) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(38, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Couldn't check whether "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(guid); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is installed. "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } Log.LogWarning(val); return false; } } internal static bool TryGetSetting<T>(string guid, string section, string key, [NotNullWhen(true)] out ConfigEntry<T>? entry) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown entry = null; try { BasePlugin plugin; return TryGetActive(guid, out plugin) && plugin.Config.TryGetEntry<T>(section, key, ref entry); } catch (Exception ex) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(25, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Couldn't read ["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(section); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(key); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" from "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(guid); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(". "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } Log.LogWarning(val); entry = null; return false; } } private static bool TryGetActive(string guid, [NotNullWhen(true)] out BasePlugin? plugin) { plugin = null; if (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.TryGetValue(guid, out var value)) { object instance = value.Instance; BasePlugin val = (BasePlugin)((instance is BasePlugin) ? instance : null); if (val != null) { ConfigEntry<bool> val2 = default(ConfigEntry<bool>); if (val.Config.TryGetEntry<bool>("0. Mod", "Enabled", ref val2) && !val2.Value) { return false; } plugin = val; return true; } } return false; } internal static bool Get(string key) { object data = AppDomain.CurrentDomain.GetData("MindAttic.GTFO." + key); if (data is bool) { return (bool)data; } return false; } internal static void Set(string key, bool value) { AppDomain.CurrentDomain.SetData("MindAttic.GTFO." + key, value); } } internal static class InfiniteToggles { private const string AmmoKey = "InfiniteAmmo"; private const string HealthKey = "InfiniteHealth"; private static readonly InventorySlot[] AmmoSlots; private static int _lastFrame; internal static bool InfiniteAmmoOn => SharedOwner.Get("InfiniteAmmo"); internal static bool InfiniteHealthOn => SharedOwner.Get("InfiniteHealth"); internal static void Tick() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if (Time.frameCount == _lastFrame || !SharedOwner.IsOwner) { return; } _lastFrame = Time.frameCount; if ((int)FocusStateManager.CurrentState == 4) { if (Input.GetKeyDown((KeyCode)277)) { Toggle("InfiniteHealth", "Infinite health"); } if (Input.GetKeyDown((KeyCode)127)) { Toggle("InfiniteAmmo", "Infinite ammo"); } } if (InfiniteAmmoOn) { Refill(); } } private static void Toggle(string key, string what) { bool flag = !SharedOwner.Get(key); SharedOwner.Set(key, flag); Show(what + ": " + (flag ? "ON" : "OFF")); } private static void Show(string message) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown try { MessageHelper.Show(message, MessageType.EventLog); } catch (Exception ex) { bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(22, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (no warden message: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } SharedOwner.Log.LogInfo(val); return; } SharedOwner.Log.LogInfo((object)message); } private static void Refill() { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) try { PlayerAgent val = default(PlayerAgent); if (!PlayerManager.TryGetLocalPlayerAgent(ref val) || (Object)(object)val == (Object)null || !((Agent)val).Alive) { return; } PlayerBackpack localBackpack = PlayerBackpackManager.LocalBackpack; PlayerAmmoStorage val2 = ((localBackpack != null) ? localBackpack.AmmoStorage : null); if (val2 == null) { return; } bool flag = false; InventorySlot[] ammoSlots = AmmoSlots; foreach (InventorySlot val3 in ammoSlots) { InventorySlotAmmo inventorySlotAmmo = val2.GetInventorySlotAmmo(val3); if (inventorySlotAmmo != null && !(inventorySlotAmmo.AmmoInPack >= inventorySlotAmmo.AmmoMaxCap)) { val2.SetAmmo(inventorySlotAmmo.AmmoType, inventorySlotAmmo.AmmoMaxCap); flag = true; } } PlayerInventoryBase inventory = val.Inventory; object obj; if (inventory == null) { obj = null; } else { ItemEquippable wieldedItem = inventory.WieldedItem; obj = ((wieldedItem != null) ? ((Il2CppObjectBase)wieldedItem).TryCast<BulletWeapon>() : null); } BulletWeapon val4 = (BulletWeapon)obj; if ((Object)(object)val4 != (Object)null && ((ItemEquippable)val4).GetCurrentClip() < ((ItemEquippable)val4).ClipSize) { ((ItemEquippable)val4).SetCurrentClip(((ItemEquippable)val4).ClipSize); val2.SetClipAmmoInSlot(val.Inventory.WieldedSlot); flag = true; } if (flag) { val2.UpdateAllAmmoUI(); val2.NeedsSync = true; } } catch (Exception ex) { bool flag2 = default(bool); BepInExWarningLogInterpolatedStringHandler val5 = new BepInExWarningLogInterpolatedStringHandler(30, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("Infinite ammo: refill failed. "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<string>(ex.Message); } SharedOwner.Log.LogWarning(val5); } } internal static bool AllowDamage(Dam_PlayerDamageLocal damage) { if (!InfiniteHealthOn) { return true; } try { PlayerAgent owner = ((Dam_PlayerDamageBase)damage).Owner; return (Object)(object)owner == (Object)null || (Object)(object)owner.Owner == (Object)null || owner.Owner.IsBot; } catch (Exception) { return true; } } static InfiniteToggles() { InventorySlot[] array = new InventorySlot[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); AmmoSlots = (InventorySlot[])(object)array; _lastFrame = -1; } } [HarmonyPatch(typeof(Dam_PlayerDamageLocal))] internal static class InfiniteToggles_Patches { [HarmonyPatch("Update")] [HarmonyPostfix] private static void AfterUpdate() { InfiniteToggles.Tick(); } [HarmonyPatch("ReceiveBulletDamage")] [HarmonyPatch("ReceiveExplosionDamage")] [HarmonyPatch("ReceiveMeleeDamage")] [HarmonyPatch("ReceivePushDamage")] [HarmonyPatch("ReceiveFireDamage")] [HarmonyPatch("ReceiveTentacleAttackDamage")] [HarmonyPatch("ReceiveTentacleTrapGrabDamage")] [HarmonyPatch("ReceiveParasiteTrapDamage")] [HarmonyPatch("ReceiveTentacleTankGrabDamage")] [HarmonyPatch("ReceiveShooterProjectileDamage")] [HarmonyPatch("ReceiveParasiteDamage")] [HarmonyPatch("ReceiveStickyDamage")] [HarmonyPatch("ReceiveFallDamage")] [HarmonyPatch("ReceiveNoAirDamage")] [HarmonyPatch("ReceiveSetDead")] [HarmonyPrefix] private static bool BeforeDamage(Dam_PlayerDamageLocal __instance) { return InfiniteToggles.AllowDamage(__instance); } } internal enum MessageType { Warden, EventLog, Center, Subtitle } internal static class MessageHelper { internal const float DefaultSeconds = 5f; private const string UpUntilKey = "MindAttic.GTFO.WardenMessageUpUntil"; private const string RoutineKey = "MindAttic.GTFO.WardenMessageRoutine"; private const float RevealSpeed = 200f; private const float StaleMargin = 3f; private static float UpUntil { get { object data = AppDomain.CurrentDomain.GetData("MindAttic.GTFO.WardenMessageUpUntil"); if (data is float) { return (float)data; } return 0f; } set { AppDomain.CurrentDomain.SetData("MindAttic.GTFO.WardenMessageUpUntil", value); } } private static IntPtr Routine { get { object data = AppDomain.CurrentDomain.GetData("MindAttic.GTFO.WardenMessageRoutine"); if (data is IntPtr) { return (IntPtr)data; } return IntPtr.Zero; } set { AppDomain.CurrentDomain.SetData("MindAttic.GTFO.WardenMessageRoutine", value); } } internal static bool Show(string text, MessageType type = MessageType.Warden, float seconds = 5f) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown bool flag = default(bool); try { seconds = Mathf.Max(0.5f, seconds); flag = type switch { MessageType.Warden => Warden(text, seconds), MessageType.EventLog => EventLog(text), MessageType.Center => Center(text, seconds), MessageType.Subtitle => Subtitle(text, seconds), _ => false, }; return flag; } catch (Exception ex) { BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(16, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (no "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<MessageType>(type); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" message: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } SharedOwner.Log.LogInfo(val); return false; } } private static bool EventLog(string text) { PlayerGuiLayer playerLayer = GuiManager.PlayerLayer; PUI_GameEventLog val = ((playerLayer != null) ? playerLayer.m_gameEventLog : null); if ((Object)(object)val == (Object)null) { return false; } val.AddLogItem(text, (eGameEventChatLogType)2); return true; } private static bool Center(string text, float seconds) { InteractionGuiLayer interactionLayer = GuiManager.InteractionLayer; if (interactionLayer == null) { return false; } interactionLayer.SetTimedMessage(text, seconds, (ePUIMessageStyle)0, 0); return true; } private static bool Subtitle(string text, float seconds) { PlayerGuiLayer playerLayer = GuiManager.PlayerLayer; PUI_Subtitles val = ((playerLayer != null) ? playerLayer.m_subtitles : null); if ((Object)(object)val == (Object)null) { return false; } val.ShowSingleLineSubtitle(text, seconds); return true; } private static bool Warden(string text, float seconds) { PlayerGuiLayer playerLayer = GuiManager.PlayerLayer; PUI_WardenIntel val = ((playerLayer != null) ? playerLayer.m_wardenIntel : null); if ((Object)(object)val == (Object)null) { return false; } Coroutine newObjectiveRoutine = val.m_newObjectiveRoutine; LinkedList<IEnumerator> subObjectiveMessageQueue = val.m_subObjectiveMessageQueue; if (Time.unscaledTime < UpUntil && newObjectiveRoutine != null && ((Il2CppObjectBase)newObjectiveRoutine).Pointer == Routine && (subObjectiveMessageQueue == null || subObjectiveMessageQueue.Count == 0)) { ((MonoBehaviour)val).StopCoroutine(newObjectiveRoutine); if (val.m_revealTextRoutine != null) { ((MonoBehaviour)val).StopCoroutine(val.m_revealTextRoutine); } val.m_newObjectiveRoutine = null; val.m_revealTextRoutine = null; val.ResetSubObjectiveMesssagQueue(); } Coroutine newObjectiveRoutine2 = val.m_newObjectiveRoutine; IntPtr intPtr = ((newObjectiveRoutine2 != null) ? ((Il2CppObjectBase)newObjectiveRoutine2).Pointer : IntPtr.Zero); float until = Time.unscaledTime + seconds + 3f; val.ShowSubObjectiveMessage("", text, false, 200f, seconds, DelegateSupport.ConvertDelegate<Action>((Delegate)(Action)delegate { if (UpUntil == until) { UpUntil = 0f; } })); Coroutine newObjectiveRoutine3 = val.m_newObjectiveRoutine; IntPtr intPtr2 = ((newObjectiveRoutine3 != null) ? ((Il2CppObjectBase)newObjectiveRoutine3).Pointer : IntPtr.Zero); if (intPtr2 != IntPtr.Zero && intPtr2 != intPtr) { Routine = intPtr2; UpUntil = until; } else { Routine = IntPtr.Zero; UpUntil = 0f; } return true; } } internal static class RemoteEvents { internal static void Register<T>(string eventName, Action<ulong, T> onReceive) where T : struct { NetworkAPI.RegisterEvent<T>(eventName, (Action<ulong, T>)delegate(ulong sender, T message) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown try { onReceive(sender, message); } catch (Exception ex) { bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(38, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Couldn't handle network event "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(eventName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" from "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<ulong>(sender); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } SharedOwner.Log.LogError(val); } }); } } } namespace GTFO.EZ.AbsurdWeapons { [HarmonyPatch(typeof(GearPartHolder), "OnAllPartsSpawned")] internal static class BladeStretcher { private static readonly Dictionary<int, (Vector3 Scale, Vector3 Position)> originals = new Dictionary<int, (Vector3, Vector3)>(); [HarmonyPostfix] private static void Postfix(GearPartHolder __instance) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown try { WeaponSettings weaponSettings = WeaponSettings.ForCategory(((GameDataBlockBase<GearCategoryDataBlock>)(object)__instance.CategoryData)?.persistentID ?? 0); if (weaponSettings != null) { GameObject val = __instance.MeleeHeadPart; GameObject val2 = __instance.MeleeHandlePart ?? __instance.MeleeNeckPart; bool flag = (Object)(object)val == (Object)null; if (flag) { val = val2; val2 = null; } if (!((Object)(object)val == (Object)null)) { WeaponSettings.Reload(); Transform pin = (((Object)(object)val2 != (Object)null) ? val2.transform : (__instance.m_aRightHand ?? ((Component)__instance).transform)); Stretch(weaponSettings.Weapon, ((Component)__instance).transform, val.transform, pin, flag, weaponSettings.BladeLength.Value, weaponSettings.BladeLengthAxis.Value); } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(49, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("GTFO.EZ.AbsurdWeapons failed to stretch a blade: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<Exception>(ex); } logger.LogError(val3); } } private static void Stretch(string weapon, Transform holder, Transform blade, Transform pin, bool onePiece, float factor, BladeAxis axisSetting) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0258: 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) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Expected O, but got Unknown //IL_0494: Unknown result type (might be due to invalid IL or missing references) int instanceID = ((Object)blade).GetInstanceID(); if (!originals.TryGetValue(instanceID, out (Vector3, Vector3) value)) { value = (blade.localScale, blade.localPosition); originals[instanceID] = value; } blade.localScale = value.Item1; blade.localPosition = value.Item2; bool flag = default(bool); if (!TryGetLocalBounds(blade, out var bounds)) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(80, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons: blade '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)blade).name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' has no mesh to measure - leaving it unstretched."); } logger.LogWarning(val); return; } bool flag2 = axisSetting == BladeAxis.All; int num = axisSetting switch { BladeAxis.X => 0, BladeAxis.Y => 1, BladeAxis.Z => 2, _ => LongestAxis(((Bounds)(ref bounds)).size), }; string text = (flag2 ? "all axes" : "XYZ"[num].ToString()); float num2 = LengthInMeters(holder, blade, ((Bounds)(ref bounds)).size, num); BepInExInfoLogInterpolatedStringHandler val2; if (Mathf.Approximately(factor, 1f)) { ManualLogSource logger2 = Plugin.Logger; val2 = new BepInExInfoLogInterpolatedStringHandler(70, 7, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GTFO.EZ.AbsurdWeapons "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(weapon); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)holder).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(onePiece ? "one-piece model" : "blade"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)blade).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' is "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(num2, "0.000"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" m along "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", unstretched. Model size "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(Describe(((Bounds)(ref bounds)).size)); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); } logger2.LogInfo(val2); return; } Vector3 val3 = blade.InverseTransformPoint(pin.position); Vector3 center = default(Vector3); if (flag2) { ((Vector3)(ref center))..ctor(Mathf.Clamp(val3.x, ((Bounds)(ref bounds)).min.x, ((Bounds)(ref bounds)).max.x), Mathf.Clamp(val3.y, ((Bounds)(ref bounds)).min.y, ((Bounds)(ref bounds)).max.y), Mathf.Clamp(val3.z, ((Bounds)(ref bounds)).min.z, ((Bounds)(ref bounds)).max.z)); } else { center = ((Bounds)(ref bounds)).center; Vector3 val4; float num6; if (!onePiece) { float num3 = ((Vector3)(ref val3))[num]; val4 = ((Bounds)(ref bounds)).min; float num4 = Mathf.Abs(num3 - ((Vector3)(ref val4))[num]); float num5 = ((Vector3)(ref val3))[num]; val4 = ((Bounds)(ref bounds)).max; if (!(num4 <= Mathf.Abs(num5 - ((Vector3)(ref val4))[num]))) { val4 = ((Bounds)(ref bounds)).max; num6 = ((Vector3)(ref val4))[num]; } else { val4 = ((Bounds)(ref bounds)).min; num6 = ((Vector3)(ref val4))[num]; } } else { float num7 = ((Vector3)(ref val3))[num]; val4 = ((Bounds)(ref bounds)).min; float num8 = ((Vector3)(ref val4))[num]; val4 = ((Bounds)(ref bounds)).max; num6 = Mathf.Clamp(num7, num8, ((Vector3)(ref val4))[num]); } ((Vector3)(ref center))[num] = num6; } Vector3 val5 = blade.TransformPoint(center); var (val6, _) = value; if (flag2) { val6 *= factor; } else { int num9 = num; ((Vector3)(ref val6))[num9] = ((Vector3)(ref val6))[num9] * factor; } blade.localScale = val6; blade.position += val5 - blade.TransformPoint(center); ManualLogSource logger3 = Plugin.Logger; val2 = new BepInExInfoLogInterpolatedStringHandler(64, 9, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GTFO.EZ.AbsurdWeapons "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(weapon); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)holder).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(onePiece ? "one-piece model" : "blade"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)blade).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(num2, "0.000"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" m -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(num2 * factor, "0.000"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" m (x"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(factor); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" along "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("). Model size "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(Describe(((Bounds)(ref bounds)).size)); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); } logger3.LogInfo(val2); } private static bool TryGetLocalBounds(Transform blade, out Bounds bounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) bounds = default(Bounds); bool flag = false; foreach (MeshFilter componentsInChild in ((Component)blade).GetComponentsInChildren<MeshFilter>(true)) { Mesh sharedMesh = componentsInChild.sharedMesh; if ((Object)(object)sharedMesh == (Object)null) { continue; } Bounds bounds2 = sharedMesh.bounds; for (int i = 0; i < 8; i++) { Vector3 val = ((Bounds)(ref bounds2)).center + Vector3.Scale(((Bounds)(ref bounds2)).extents, new Vector3((float)(((i & 1) != 0) ? 1 : (-1)), (float)(((i & 2) != 0) ? 1 : (-1)), (float)(((i & 4) != 0) ? 1 : (-1)))); Vector3 val2 = blade.InverseTransformPoint(((Component)componentsInChild).transform.TransformPoint(val)); if (!flag) { bounds = new Bounds(val2, Vector3.zero); } else { ((Bounds)(ref bounds)).Encapsulate(val2); } flag = true; } } return flag; } private static float LengthInMeters(Transform holder, Transform blade, Vector3 size, int axis) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Vector3 zero = Vector3.zero; ((Vector3)(ref zero))[axis] = ((Vector3)(ref size))[axis]; Vector3 val = holder.InverseTransformVector(blade.TransformVector(zero)); return ((Vector3)(ref val)).magnitude; } private static string Describe(Vector3 size) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) return $"X {size.x:0.000} / Y {size.y:0.000} / Z {size.z:0.000}"; } private static int LongestAxis(Vector3 size) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!(size.x >= size.y) || !(size.x >= size.z)) { if (!(size.y >= size.z)) { return 2; } return 1; } return 0; } } internal static class ChainLightning { private readonly struct BoltMessage { public readonly byte Count; public readonly byte Struck; public readonly float X0; public readonly float Y0; public readonly float Z0; public readonly float X1; public readonly float Y1; public readonly float Z1; public readonly float X2; public readonly float Y2; public readonly float Z2; public readonly float X3; public readonly float Y3; public readonly float Z3; public readonly float X4; public readonly float Y4; public readonly float Z4; public readonly float X5; public readonly float Y5; public readonly float Z5; public readonly float X6; public readonly float Y6; public readonly float Z6; public BoltMessage(List<Vector3> path, bool struckEnemies) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_007b: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) Count = (byte)Math.Min(path.Count, 7); Struck = (struckEnemies ? ((byte)1) : ((byte)0)); float x = P(0).x; float y = P(0).y; float z = P(0).z; X0 = x; Y0 = y; Z0 = z; z = P(1).x; y = P(1).y; x = P(1).z; X1 = z; Y1 = y; Z1 = x; x = P(2).x; y = P(2).y; z = P(2).z; X2 = x; Y2 = y; Z2 = z; z = P(3).x; y = P(3).y; x = P(3).z; X3 = z; Y3 = y; Z3 = x; x = P(4).x; y = P(4).y; z = P(4).z; X4 = x; Y4 = y; Z4 = z; z = P(5).x; y = P(5).y; x = P(5).z; X5 = z; Y5 = y; Z5 = x; x = P(6).x; y = P(6).y; z = P(6).z; X6 = x; Y6 = y; Z6 = z; Vector3 P(int i) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (i >= path.Count) { return Vector3.zero; } return path[i]; } } public Vector3[] Points() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0074: 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_0092: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[7] { new Vector3(X0, Y0, Z0), new Vector3(X1, Y1, Z1), new Vector3(X2, Y2, Z2), new Vector3(X3, Y3, Z3), new Vector3(X4, Y4, Z4), new Vector3(X5, Y5, Z5), new Vector3(X6, Y6, Z6) }; Vector3[] array2 = (Vector3[])(object)new Vector3[Math.Min(Count, array.Length)]; Array.Copy(array, array2, array2.Length); return array2; } } internal const int MaxJumps = 5; private static ConfigEntry<int> Jumps; private static ConfigEntry<float> Range; private static ConfigEntry<float> AssistConeDegrees; private static ConfigEntry<float> JumpRange; private static ConfigEntry<float> JumpFalloff; private static ConfigEntry<float> StaggerMulti; private const string BoltEvent = "MindAttic.GTFO.EZ.AbsurdWeapons.ChainLightning"; private const float BoltForward = 0.9f; internal const float TickSeconds = 0.08f; internal static void Bind(ConfigFile config) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown Range = config.Bind<float>("Chain Lightning Gun", "Range", 40f, "Metres the first strike reaches."); AssistConeDegrees = config.Bind<float>("Chain Lightning Gun", "AssistConeDegrees", 6f, "A near-miss within this cone still finds a first target."); JumpRange = config.Bind<float>("Chain Lightning Gun", "JumpRange", 8f, "Metres each jump can reach the next enemy."); JumpFalloff = config.Bind<float>("Chain Lightning Gun", "JumpFalloff", 0.75f, "Share of the previous strike's damage each jump does."); StaggerMulti = config.Bind<float>("Chain Lightning Gun", "StaggerMulti", 2f, "Stagger multiplier per strike."); Jumps = config.Bind<int>("Chain Lightning Gun", "Jumps", 5, new ConfigDescription($"How many times a bolt leaps on to another enemy after the first strike (at most {5}). 0 strikes one enemy only.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 5), Array.Empty<object>())); } internal static void Init() { RemoteEvents.Register("MindAttic.GTFO.EZ.AbsurdWeapons.ChainLightning", delegate(ulong sender, BoltMessage message) { LightningBolt.Spawn(message.Points(), message.Struck != 0, sender); }); } internal static void Fire(PlayerAgent owner, Vector3 eye, Vector3 aim, float damage, uint gearCategoryId, Transform? muzzle = null) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3> { ((Object)(object)muzzle != (Object)null) ? Barrel.Start(owner, muzzle, eye, aim) : LaserGuns.ScreenStart(eye, aim, 0.9f) }; HashSet<IntPtr> hashSet = new HashSet<IntPtr>(); EnemyAgent val = null; Dam_EnemyDamageLimb val2 = null; Vector3 val3 = eye + aim * Range.Value; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(eye, aim, ref val4, Range.Value, LayerManager.MASK_BULLETWEAPON_RAY)) { val3 = ((RaycastHit)(ref val4)).point; val2 = ((Component)((RaycastHit)(ref val4)).collider).GetComponent<Dam_EnemyDamageLimb>(); object obj; if (val2 == null) { obj = null; } else { Dam_EnemyDamageBase obj2 = val2.m_base; obj = ((obj2 != null) ? obj2.Owner : null); } val = (EnemyAgent)obj; if ((Object)(object)val == (Object)null && LockDamage.TryHit(((RaycastHit)(ref val4)).collider, damage, ((Il2CppObjectBase)owner).Cast<Agent>(), ((RaycastHit)(ref val4)).point, aim, ((RaycastHit)(ref val4)).normal)) { list.Add(val3); Send(list, owner, struckEnemies: false); return; } } if ((Object)(object)val == (Object)null) { List<EnemyAgent> list2 = SeekerGuns.FindLocks(eye, aim, AssistConeDegrees.Value, Range.Value); if (list2.Count > 0) { val = list2[0]; val2 = NearestLimb(val, ((Agent)val).AimTarget.position); val3 = ((Agent)val).AimTarget.position; } } if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || !((Agent)val).Alive) { list.Add(val3); Send(list, owner, struckEnemies: false); return; } float num = damage; int num2 = Mathf.Clamp(Jumps.Value, 0, 5); for (int i = 0; i <= num2; i++) { if (!((Object)(object)val != (Object)null)) { break; } if (!((Object)(object)val2 != (Object)null)) { break; } hashSet.Add(((Il2CppObjectBase)val).Pointer); Vector3 val5 = list[list.Count - 1]; Vector3 val6 = val3 - val5; Vector3 val7; if (!(((Vector3)(ref val6)).sqrMagnitude > 0.0001f)) { val7 = aim; } else { val6 = val3 - val5; val7 = ((Vector3)(ref val6)).normalized; } Vector3 val8 = val7; val2.BulletDamage(num, ((Il2CppObjectBase)owner).Cast<Agent>(), val3, val8, -val8, false, StaggerMulti.Value, 1f, gearCategoryId); list.Add(val3); num *= JumpFalloff.Value; val = NextTarget(val3, hashSet); if ((Object)(object)val == (Object)null) { break; } val3 = ((Agent)val).AimTarget.position; val2 = NearestLimb(val, val3); } Send(list, owner, struckEnemies: true); } internal static bool Pulse(PlayerAgent owner, Vector3 from, float range, float damage, int jumps, uint gearCategoryId) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) HashSet<IntPtr> hashSet = new HashSet<IntPtr>(); EnemyAgent val = NextTarget(from, hashSet, range); if ((Object)(object)val == (Object)null) { return false; } List<Vector3> list = new List<Vector3> { from }; float num = damage; for (int i = 0; i <= jumps; i++) { if (!((Object)(object)val != (Object)null)) { break; } Vector3 position = ((Agent)val).AimTarget.position; Dam_EnemyDamageLimb val2 = NearestLimb(val, position); if ((Object)(object)val2 == (Object)null) { break; } hashSet.Add(((Il2CppObjectBase)val).Pointer); Vector3 val3 = position - list[list.Count - 1]; Vector3 normalized = ((Vector3)(ref val3)).normalized; val2.BulletDamage(num, ((Il2CppObjectBase)owner).Cast<Agent>(), position, normalized, -normalized, false, StaggerMulti.Value, 1f, gearCategoryId); list.Add(position); num *= JumpFalloff.Value; val = NextTarget(position, hashSet); } Send(list, owner, list.Count > 1); return true; } private static void Send(List<Vector3> path, PlayerAgent owner, bool struckEnemies) { LightningBolt.Spawn(path.ToArray(), struckEnemies, ((Object)(object)owner.Owner != (Object)null) ? owner.Owner.Lookup : 0); NetworkAPI.InvokeEvent<BoltMessage>("MindAttic.GTFO.EZ.AbsurdWeapons.ChainLightning", new BoltMessage(path, struckEnemies), (SNet_ChannelType)2); } private static EnemyAgent? NextTarget(Vector3 from, HashSet<IntPtr> struck, float? range = null) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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) float num = range ?? JumpRange.Value; EnemyAgent result = null; float num2 = float.MaxValue; foreach (Collider item in (Il2CppArrayBase<Collider>)(object)Physics.OverlapSphere(from, num, LayerManager.MASK_ENEMY_DAMAGABLE)) { Dam_EnemyDamageLimb component = ((Component)item).GetComponent<Dam_EnemyDamageLimb>(); object obj; if (component == null) { obj = null; } else { Dam_EnemyDamageBase obj2 = component.m_base; obj = ((obj2 != null) ? obj2.Owner : null); } EnemyAgent val = (EnemyAgent)obj; if (!((Object)(object)val == (Object)null) && ((Agent)val).Alive && !struck.Contains(((Il2CppObjectBase)val).Pointer)) { Vector3 position = ((Agent)val).AimTarget.position; float num3 = Vector3.Distance(from, position); if (!(num3 >= num2) && !Physics.Linecast(from, position, LayerManager.MASK_WORLD)) { result = val; num2 = num3; } } } return result; } internal static Dam_EnemyDamageLimb? NearestLimb(EnemyAgent enemy, Vector3 point) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Dam_EnemyDamageLimb result = null; float num = float.MaxValue; foreach (Dam_EnemyDamageLimb componentsInChild in ((Component)enemy).GetComponentsInChildren<Dam_EnemyDamageLimb>()) { Vector3 val = ((Component)componentsInChild).transform.position - point; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = componentsInChild; } } return result; } } internal sealed class LightningBolt : MonoBehaviour { private const float Seconds = 0.16f; private const float SegmentLength = 0.35f; private const float Jitter = 0.18f; private static readonly Color BoltColor = new Color(0.7f, 0.85f, 1f, 1f); private static readonly Color FlashColor = new Color(0.45f, 0.75f, 1f); private static Material? material; private LineRenderer line; private Vector3[] points = Array.Empty<Vector3>(); private float age; public LightningBolt(IntPtr ptr) : base(ptr) { } [HideFromIl2Cpp] internal static void Spawn(Vector3[] points, bool struckEnemies, ulong source = 0uL) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_010b: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) if (points.Length < 2) { return; } LoopSounds.Touch($"lightning:{source}", Sounds.LightningLoopStart.Value, Sounds.LightningLoopStop.Value, points[1]); Sounds.PlayLimited($"crackle:{source}", 0.25f, Sounds.LightningCrackle.Value, points[^1]); GameObject val = new GameObject("GTFO.EZ.AbsurdWeapons Lightning Bolt"); LightningBolt lightningBolt = val.AddComponent<LightningBolt>(); lightningBolt.points = points; lightningBolt.line = val.AddComponent<LineRenderer>(); lightningBolt.line.useWorldSpace = true; lightningBolt.line.numCapVertices = 2; if ((Object)(object)material == (Object)null) { material = new Material(Shader.Find("Sprites/Default")); } ((Renderer)lightningBolt.line).material = material; lightningBolt.Jag(); for (int i = 1; i < points.Length; i++) { if (struckEnemies) { BurstFlash.Spawn(points[i], FlashColor, 4f, 4f, 0.15f); } try { FX_Manager.PlayEffect(false, (FX_GroupName)13, points[i], Quaternion.LookRotation(points[i] - points[i - 1]), false); } catch (Exception) { } } } private void Update() { age += Time.deltaTime; if (age >= 0.16f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Jag(); } } [HideFromIl2Cpp] private void Jag() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3> { points[0] }; for (int i = 1; i < points.Length; i++) { Vector3 val = points[i - 1]; Vector3 val2 = points[i]; int num = Mathf.Clamp(Mathf.CeilToInt(Vector3.Distance(val, val2) / 0.35f), 1, 120); for (int j = 1; j < num; j++) { list.Add(Vector3.Lerp(val, val2, (float)j / (float)num) + Random.insideUnitSphere * 0.18f); } list.Add(val2); } line.positionCount = list.Count; for (int k = 0; k < list.Count; k++) { line.SetPosition(k, list[k]); } float num2 = 1f - age / 0.16f; float num3 = 0.05f * (0.6f + 0.4f * Random.value); LineRenderer obj = line; float startWidth = (line.endWidth = num3); obj.startWidth = startWidth; LineRenderer obj2 = line; LineRenderer obj3 = line; Color val3 = default(Color); ((Color)(ref val3))..ctor(BoltColor.r, BoltColor.g, BoltColor.b, num2); obj3.endColor = val3; obj2.startColor = val3; } } internal sealed class ChainLightningDriver : MonoBehaviour { private float nextTick; public ChainLightningDriver(IntPtr ptr) : base(ptr) { } private void Update() { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_010a: 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) try { PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); if ((Object)(object)localPlayerAgent == (Object)null || !((Agent)localPlayerAgent).Alive || (int)FocusStateManager.CurrentState != 4 || StreamReadiness.Blocked(localPlayerAgent) || !StreamReadiness.IsSettled(localPlayerAgent)) { return; } PlayerInventoryBase inventory = localPlayerAgent.Inventory; object obj; if (inventory == null) { obj = null; } else { ItemEquippable wieldedItem = inventory.WieldedItem; obj = ((wieldedItem != null) ? ((Il2CppObjectBase)wieldedItem).TryCast<BulletWeapon>() : null); } BulletWeapon val = (BulletWeapon)obj; ArchetypeDataBlock val2 = ((val != null) ? ((ItemEquippable)val).ArchetypeData : null); if (!((Object)(object)val == (Object)null) && val2 != null && ((GameDataBlockBase<ArchetypeDataBlock>)(object)val2).persistentID == 1109 && InputMapper.GetButtonKeyMouse((InputAction)8, (eFocusState)4)) { FPSCamera fPSCamera = localPlayerAgent.FPSCamera; if (!((Object)(object)fPSCamera == (Object)null) && InfiniteAmmo.HasStreamAmmo(localPlayerAgent) && InfiniteAmmo.Drain(localPlayerAgent, Time.deltaTime) && !(Time.time < nextTick)) { nextTick = Time.time + 0.08f; float damage = val2.Damage * 0.08f / Mathf.Max(0.02f, val2.ShotDelay); ChainLightning.Fire(localPlayerAgent, fPSCamera.Position, fPSCamera.Forward, damage, 1109u, ((ItemEquippable)val).MuzzleAlign); } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(53, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("GTFO.EZ.AbsurdWeapons chain lightning driver failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message); } logger.LogError(val3); nextTick = Time.time + 1f; } } } internal sealed class ChainLightningGlow : MonoBehaviour { internal static readonly Color GlowColor = new Color(0.6f, 0.3f, 1f); private readonly Dictionary<IntPtr, (IntPtr Item, EffectLight Light)> lit = new Dictionary<IntPtr, (IntPtr, EffectLight)>(); public ChainLightningGlow(IntPtr ptr) : base(ptr) { } private void Update() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown bool flag = default(bool); try { HashSet<IntPtr> hashSet = ((lit.Count > 0) ? new HashSet<IntPtr>() : null); List<PlayerAgent> playerAgentsInLevel = PlayerManager.PlayerAgentsInLevel; if (playerAgentsInLevel != null) { Enumerator<PlayerAgent> enumerator = playerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent current = enumerator.Current; if ((Object)(object)current == (Object)null) { continue; } hashSet?.Add(((Il2CppObjectBase)current).Pointer); try { Light(current); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(51, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons Chain Lightning glow failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } logger.LogError(val); PutOut(((Il2CppObjectBase)current).Pointer); } } } if (hashSet == null) { return; } List<IntPtr> list = null; foreach (IntPtr key in lit.Keys) { if (!hashSet.Contains(key)) { (list ?? (list = new List<IntPtr>())).Add(key); } } if (list == null) { return; } foreach (IntPtr item in list) { PutOut(item); } } catch (Exception ex2) { ManualLogSource logger2 = Plugin.Logger; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(51, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons Chain Lightning glow failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex2.Message); } logger2.LogError(val); } } [HideFromIl2Cpp] private void Light(PlayerAgent player) { //IL_011b: 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_00cc: Unknown result type (might be due to invalid IL or missing references) PlayerInventoryBase inventory = player.Inventory; ItemEquippable val = ((inventory != null) ? inventory.WieldedItem : null); int num; if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeInHierarchy) { BulletWeapon obj = ((Il2CppObjectBase)val).TryCast<BulletWeapon>(); num = ((obj != null && ((GameDataBlockBase<ArchetypeDataBlock>)(object)((ItemEquippable)obj).ArchetypeData)?.persistentID == 1109) ? 1 : 0); } else { num = 0; } bool flag = (byte)num != 0; (IntPtr, EffectLight) value; bool flag2 = lit.TryGetValue(((Il2CppObjectBase)player).Pointer, out value); if (flag2 && (!flag || value.Item1 != ((Il2CppObjectBase)val).Pointer || (Object)(object)value.Item2 == (Object)null)) { PutOut(((Il2CppObjectBase)player).Pointer); flag2 = false; } if (flag) { if (!flag2) { EffectLight val2 = new GameObject("GTFO.EZ.AbsurdWeapons Chain Lightning Glow").AddComponent<EffectLight>(); ((LightBase)val2).Color = GlowColor; ((LightBase)val2).Range = 1.2f; ((Behaviour)val2).enabled = true; value = (((Il2CppObjectBase)val).Pointer, val2); lit[((Il2CppObjectBase)player).Pointer] = value; } ((Component)value.Item2).transform.position = ((Component)val).transform.position; ((LightBase)value.Item2).Intensity = 0.2f * (0.75f + 0.25f * Mathf.Sin(Time.time * 12f)); } } [HideFromIl2Cpp] private void PutOut(IntPtr player) { if (lit.TryGetValue(player, out (IntPtr, EffectLight) value)) { lit.Remove(player); if (!((Object)(object)value.Item2 == (Object)null)) { ((LightBase)value.Item2).Intensity = 0f; ((Behaviour)value.Item2).enabled = false; Object.Destroy((Object)(object)((Component)value.Item2).gameObject); } } } } internal static class ConfigMigrations { private static readonly (int Version, string Section, string Key, object OldDefault)[] DefaultMigrations = new(int, string, string, object)[26] { (1, "Tentacle Guns", "Damage", 22f), (1, "Tentacle Guns", "EngageConeDegrees", 15f), (1, "Plasma Guns", "BlastRadius", 1.25f), (2, "Chain Lightning Gun", "Damage", 10f), (2, "Tentacle Guns", "Damage", 35f), (2, "Tentacle Guns", "StaggerMulti", 5f), (3, "Tentacle Guns", "Damage", 100f), (4, "Shrink Beam", "MinScale", 0.25f), (4, "Shrink Beam", "StepOnScale", 0.4f), (4, "Shrink Beam", "StepOnRadius", 0.6f), (4, "Sounds", "ShrinkLoopStart", "BIOTRACKER_TOOL_LOOP"), (4, "Sounds", "ShrinkLoopStop", "BIOTRACKER_TOOL_LOOP_STOP"), (5, "Shadow Dagger", "StealthKillTimeBonus", 0.25f), (6, "Shadow Dagger", "StealthSeconds", 2f), (7, "Loot", "KitSize", 100), (8, "Hand Grenade", "StartingCount", 3), (9, "Loot", "HandGrenadeWeight", 2f), (10, "Stim Pack", "Stim Pack Enabled", true), (11, "Ammo", "StreamPercentPerSecond", 1f), (12, "Railgun", "Damage", 150f), (12, "Railgun", "PenetrationRange", 200f), (12, "Shrink Beam", "MinScale", 0.33f), (12, "Shrink Beam", "StepOnScale", 0.5f), (12, "Shrink Beam", "StepOnRadius", 1f), (13, "Stim Pack", "Stim Pack Enabled", false), (14, "Stim Pack", "HealPercent", 50f) }; internal static void Apply(ConfigFile config) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown ConfigEntry<int> val = config.Bind<int>("Internal", "Config Migration Version", 0, "Internal bookkeeping - do not edit. Tracks which one-time default migrations have already run."); int value = val.Value; int num = value; (int, string, string, object)[] defaultMigrations = DefaultMigrations; bool flag = default(bool); for (int i = 0; i < defaultMigrations.Length; i++) { (int, string, string, object) tuple = defaultMigrations[i]; int item = tuple.Item1; string item2 = tuple.Item2; string item3 = tuple.Item3; object item4 = tuple.Item4; num = Math.Max(num, item); if (value >= item) { continue; } ConfigDefinition val2 = new ConfigDefinition(item2, item3); if (!config.ContainsKey(val2)) { continue; } ConfigEntryBase val3 = config[val2]; if (object.Equals(val3.BoxedValue, item4)) { val3.BoxedValue = val3.DefaultValue; ManualLogSource logger = Plugin.Logger; BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(66, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("GTFO.EZ.AbsurdWeapons config: ["); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(item2); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("] "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(item3); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" moved from its old default "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<object>(item4); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" to "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<object>(val3.DefaultValue); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("."); } logger.LogInfo(val4); } } if (num != value) { val.Value = num; } } } internal static class DataBlocks { internal static readonly HashSet<uint> AddedCategories = new HashSet<uint>(); internal static T Lookup<T>(string name) where T : GameDataBlockBase<T> { return GameDataBlockBase<T>.GetBlock(GameDataBlockBase<T>.GetBlockID(name)) ?? throw new InvalidOperationException($"vanilla {typeof(T).Name} '{name}' not found"); } internal static T Clone<T>(T source) where T : GameDataBlockBase<T>, new() { return CopyObject(source); } internal static T CopyObject<T>(T source) where T : new() { T val = new T(); PropertyInfo[] properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public); foreach (PropertyInfo propertyInfo in properties) { if (propertyInfo.CanRead && propertyInfo.CanWrite && propertyInfo.GetIndexParameters().Length == 0) { propertyInfo.SetValue(val, propertyInfo.GetValue(source)); } } return val; } internal static uint? CategoryIdOf(PlayerOfflineGearDataBlock gear) { return GearJson.CategoryId(gear.GearJSON); } internal static eWeaponFireMode FireModeOf(PlayerOfflineGearDataBlock gear) { return (eWeaponFireMode)GearJson.FireModeId(gear.GearJSON); } internal static string DisplayName(string name) { return GearJson.DisplayName(name); } internal static string SetGearComponent(string json, int component, uint value) { return GearJson.SetComponent(json, component, value); } internal static string? RewriteGearJson(string json, uint fromCategory, uint toCategory, string name) { return GearJson.Rewrite(json, fromCategory, toCategory, name); } } internal sealed class GearCycler : MonoBehaviour { private sealed class SavedAmmo { public int? Clip; public AmmoType? AmmoType; public float Reserve; } private static ConfigEntry<KeyCode> toggleKey = null; private static readonly (InputAction Action, InventorySlot Slot)[] SlotKeys = new(InputAction, InventorySlot)[4] { ((InputAction)26, (InventorySlot)10), ((InputAction)23, (InventorySlot)1), ((InputAction)24, (InventorySlot)2), ((InputAction)25, (InventorySlot)3) }; private readonly Dictionary<InventorySlot, GearIDRange> starting = new Dictionary<InventorySlot, GearIDRange>(); private readonly Dictionary<uint, SavedAmmo> ammo = new Dictionary<uint, SavedAmmo>(); private readonly Dictionary<InventorySlot, uint> pending = new Dictionary<InventorySlot, uint>(); private InventorySlot wieldSlot; private float pendingFrom; private float pendingGiveUpAt; private bool active; private float? startingHealth; public GearCycler(IntPtr ptr) : base(ptr) { } internal static void Bind(ConfigFile config) { toggleKey = config.Bind<KeyCode>("Gear Cycling", "ToggleAbsurdWeaponsKey", (KeyCode)279, "Switches Absurd Weapons on (and snapshots your current gear and health) or, pressed again, off - putting every swapped slot and your health back to that snapshot. Off at the start of every level."); } private void Update() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_0069: Unknown result type (might be due to invalid IL or missing references) try { if ((int)GameStateManager.CurrentStateName != 10) { starting.Clear(); ammo.Clear(); pending.Clear(); wieldSlot = (InventorySlot)0; active = false; startingHealth = null; return; } if (pending.Count > 0) { FinishPending(); } if ((int)FocusStateManager.CurrentState == 4) { if (Input.GetKeyDown(toggleKey.Value)) { ToggleActive(); } else if (active && SlotKeyPressedAgain()) { Cycle(1); } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(43, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons gear cycling failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } logger.LogError(val); } } private void ToggleActive() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); if ((Object)(object)localPlayerAgent == (Object)null || !((Agent)localPlayerAgent).Alive) { return; } if (!active) { active = true; starting.Clear(); (InputAction, InventorySlot)[] slotKeys = SlotKeys; for (int i = 0; i < slotKeys.Length; i++) { InventorySlot item = slotKeys[i].Item2; GearIDRange val = GearIn(item); if (val != null) { starting[item] = val; } } Dam_PlayerDamageBase damage = localPlayerAgent.Damage; startingHealth = ((damage != null) ? new float?(((Dam_SyncedDamageBase)damage).Health) : ((float?)null)); Announce("Absurd Weapons: ON"); } else { Restore(localPlayerAgent); active = false; starting.Clear(); startingHealth = null; Announce("Absurd Weapons: OFF - starting loadout restored"); } } private void Restore(PlayerAgent player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) InventorySlot wieldedSlot = player.Inventory.WieldedSlot; foreach (KeyValuePair<InventorySlot, GearIDRange> item in starting) { item.Deconstruct(out var key, out var value); InventorySlot val = key; GearIDRange val2 = value; uint compID = val2.GetCompID((eGearComponent)2); if ((pending.TryGetValue(val, out var value2) ? value2 : CategoryIn(val)) != compID) { if (!pending.ContainsKey(val)) { SaveAmmo(val); } Equip(val, val2); } } if ((int)wieldedSlot != 0) { wieldSlot = wieldedSlot; } if (startingHealth.HasValue && (Object)(object)player.Damage != (Object)null) { ((Dam_SyncedDamageBase)player.Damage).SendSetHealth(startingHealth.Value); } } private void Cycle(int step) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_0052: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); if ((Object)(object)localPlayerAgent == (Object)null || !((Agent)localPlayerAgent).Alive) { return; } InventorySlot wieldedSlot = localPlayerAgent.Inventory.WieldedSlot; if ((wieldedSlot - 1 > 2 && (int)wieldedSlot != 10) || 1 == 0) { Show("Hold a main, special, tool or melee weapon to cycle it"); return; } List<GearIDRange> list = new List<GearIDRange>(); foreach (GearIDRange item in (Il2CppArrayBase<GearIDRange>)(object)GearManager.GetAllGearForSlot(wieldedSlot)) { if (IsOurs(item.GetCompID((eGearComponent)2))) { list.Add(item); } } if (list.Count == 0) { Show("No GTFO.EZ.AbsurdWeapons weapons for this slot"); return; } uint value; uint current2 = (pending.TryGetValue(wieldedSlot, out value) ? value : CategoryIn(wieldedSlot)); if (!starting.ContainsKey(wieldedSlot)) { GearIDRange val = GearIn(wieldedSlot); if (val != null) { starting[wieldedSlot] = val; } } List<GearIDRange> list2 = new List<GearIDRange>(); if (starting.TryGetValue(wieldedSlot, out GearIDRange value2) && !IsOurs(value2.GetCompID((eGearComponent)2))) { list2.Add(value2); } list2.AddRange(list); int num = Formulas.CycleIndex(list2.FindIndex((GearIDRange g) => g.GetCompID((eGearComponent)2) == current2), step, list2.Count); GearIDRange val2 = list2[num]; uint compID = val2.GetCompID((eGearComponent)2); if (!pending.ContainsKey(wieldedSlot)) { SaveAmmo(wieldedSlot); } Equip(wieldedSlot, val2); GearCategoryDataBlock block = GameDataBlockBase<GearCategoryDataBlock>.GetBlock(compID); object obj; if (block == null) { obj = null; } else { LocalizedText publicName = block.PublicName; obj = ((publicName != null) ? publicName.UntranslatedText : null); } string text = (string)obj; Show($"{text ?? "weapon"} [{num + 1}/{list2.Count}]"); } private static bool SlotKeyPressedAgain() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); InventorySlot? obj; if (localPlayerAgent == null) { obj = null; } else { PlayerInventoryBase inventory = localPlayerAgent.Inventory; obj = ((inventory != null) ? new InventorySlot?(inventory.WieldedSlot) : ((InventorySlot?)null)); } InventorySlot? val = obj; InventorySlot valueOrDefault = val.GetValueOrDefault(); (InputAction, InventorySlot)[] slotKeys = SlotKeys; for (int i = 0; i < slotKeys.Length; i++) { (InputAction, InventorySlot) tuple = slotKeys[i]; var (val2, _) = tuple; if (tuple.Item2 == valueOrDefault && InputMapper.GetButtonDownKeyMouse(val2, (eFocusState)4)) { return true; } } return false; } private void Equip(InventorySlot slot, GearIDRange gear) { //IL_000c: 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_001b: Unknown result type (might be due to invalid IL or missing references) PlayerBackpackManager.EquipLocalGear(gear); pending[slot] = gear.GetCompID((eGearComponent)2); wieldSlot = slot; pendingFrom = Time.time + 0.4f; pendingGiveUpAt = Time.time + 5f; } private void SaveAmmo(InventorySlot slot) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 PlayerBackpack localBackpack = PlayerBackpackManager.LocalBackpack; BackpackItem val = default(BackpackItem); if (localBackpack != null && localBackpack.TryGetBackpackItem(slot, ref val) && ((val != null) ? val.GearIDRange : null) != null) { SavedAmmo savedAmmo = new SavedAmmo(); Item instance = val.Instance; BulletWeapon val2 = ((instance != null) ? ((Il2CppObjectBase)instance).TryCast<BulletWeapon>() : null); if ((Object)(object)val2 != (Object)null) { savedAmmo.Clip = ((ItemEquippable)val2).GetCurrentClip(); } if ((int)slot == 1 || (int)slot == 2 || (int)slot == 3) { AmmoType ammoTypeFromSlot = PlayerAmmoStorage.GetAmmoTypeFromSlot(slot); savedAmmo.AmmoType = ammoTypeFromSlot; savedAmmo.Reserve = localBackpack.AmmoStorage.GetAmmoInPack(ammoTypeFromSlot); } ammo[val.GearIDRange.GetCompID((eGearComponent)2)] = savedAmmo; } } private void FinishPending() { //IL_003c: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Invalid comparison between Unknown and I4 //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Invalid comparison between Unknown and I4 //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Invalid comparison between Unknown and I4 //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) if (Time.time < pendingFrom) { return; } PlayerBackpack localBackpack = PlayerBackpackManager.LocalBackpack; if (localBackpack == null) { return; } bool flag = true; InventorySlot key; uint value; BackpackItem val2 = default(BackpackItem); foreach (KeyValuePair<InventorySlot, uint> item in pending) { item.Deconstruct(out key, out value); InventorySlot val = key; uint num = value; if (localBackpack.TryGetBackpackItem(val, ref val2) && val2 != null && val2.IsLoaded && !((Object)(object)val2.Instance == (Object)null)) { GearIDRange gearIDRange = val2.GearIDRange; if (gearIDRange != null && gearIDRange.GetCompID((eGearComponent)2) == num) { continue; } } flag = false; } if (!flag && Time.time < pendingGiveUpAt) { return; } if (!flag) { Plugin.Logger.LogWarning((object)"GTFO.EZ.AbsurdWeapons: swapped gear took too long to build; setting its ammo anyway."); } PlayerAmmoStorage ammoStorage = localBackpack.AmmoStorage; BackpackItem val4 = default(BackpackItem); foreach (KeyValuePair<InventorySlot, uint> item2 in pending) { item2.Deconstruct(out key, out value); InventorySlot val3 = key; uint num2 = value; localBackpack.TryGetBackpackItem(val3, ref val4); if (((val4 != null) ? val4.GearIDRange : null) != null && val4.GearIDRange.GetCompID((eGearComponent)2) != num2) { continue; } object obj; if (val4 == null) { obj = null; } else { Item instance = val4.Instance; obj = ((instance != null) ? ((Il2CppObjectBase)instance).TryCast<BulletWeapon>() : null); } BulletWeapon val5 = (BulletWeapon)obj; bool flag2 = (int)val3 == 1 || (int)val3 == 2 || (int)val3 == 3; if (ammo.TryGetValue(num2, out SavedAmmo value2)) { if (value2.AmmoType.HasValue) { ammoStorage.SetAmmo(value2.AmmoType.Value, value2.Reserve); } if (value2.Clip.HasValue && val5 != null) { ((ItemEquippable)val5).SetCurrentClip(value2.Clip.Value); } } else if (IsOurs(num2)) { if (flag2) { InventorySlotAmmo inventorySlotAmmo = ammoStorage.GetInventorySlotAmmo(val3); if (inventorySlotAmmo != null) { ammoStorage.SetAmmo(inventorySlotAmmo.AmmoType, inventorySlotAmmo.AmmoMaxCap); } } if ((Object)(object)val5 != (Object)null) { ((ItemEquippable)val5).SetCurrentClip(((ItemEquippable)val5).ClipSize); } } if (flag2) { InventorySlotAmmo inventorySlotAmmo2 = ammoStorage.GetInventorySlotAmmo(val3); object obj2; if (val4 == null) { obj2 = null; } else { Item instance2 = val4.Instance; obj2 = ((instance2 != null) ? ((Il2CppObjectBase)instance2).TryCast<ItemEquippable>() : null); } ItemEquippable val6 = (ItemEquippable)obj2; if (inventorySlotAmmo2 != null && (Object)(object)val6 != (Object)null) { ammoStorage.UpdateSlotAmmoUI(inventorySlotAmmo2, val6.GetCurrentClip()); } } } ammoStorage.UpdateAllAmmoUI(); ammoStorage.NeedsSync = true; pending.Clear(); if ((int)wieldSlot != 0) { PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); if (localPlayerAgent != null) { PlayerSync sync = localPlayerAgent.Sync; if (sync != null) { sync.WantsToWieldSlot(wieldSlot, false); } } } wieldSlot = (InventorySlot)0; } private static GearIDRange? GearIn(InventorySlot slot) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) PlayerBackpack localBackpack = PlayerBackpackManager.LocalBackpack; BackpackItem val = default(BackpackItem); if (localBackpack == null || !localBackpack.TryGetBackpackItem(slot, ref val)) { return null; } if (val == null) { return null; } return val.GearIDRange; } private static uint CategoryIn(InventorySlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) GearIDRange? obj = GearIn(slot); if (obj == null) { return 0u; } return obj.GetCompID((eGearComponent)2); } private static bool IsOurs(uint categoryId) { return DataBlocks.AddedCategories.Contains(categoryId); } internal static void Show(string message) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (!MessageHelper.Show(message, MessageType.Center, 3f)) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(message); } logger.LogInfo(val); } } private static void Announce(string message) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown Show(message); ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GTFO.EZ.AbsurdWeapons: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(message); } logger.LogInfo(val); } } internal static class GrenadeLauncher { private readonly struct LaunchMessage { public readonly uint Id; public readonly float X; public readonly float Y; public readonly float Z; public readonly float VelX; public readonly float VelY; public readonly float VelZ; public LaunchMessage(uint id, Vector3 position, Vector3 velocity) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) Id = id; float x = position.x; float y = position.y; float z = position.z; X = x; Y = y; Z = z; z = velocity.x; y = velocity.y; x = velocity.z; VelX = z; VelY = y; VelZ = x; } } private readonly struct DetonateMessage { public readonly uint Id; public readonly float X; public readonly float Y; public readonly float Z; public DetonateMessage(uint id, Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Id = id; float x = position.x; float y = position.y; float z = position.z; X = x; Y = y; Z = z; } } internal static ConfigEntry<float> Speed; internal static ConfigEntry<float> FuseSeconds; internal static ConfigEntry<float> BlastRadius; internal static ConfigEntry<float> BlastDamage; internal static ConfigEntry<float> BlastEdgeFraction; internal static ConfigEntry<float> BlastStagger; internal static ConfigEntry<float> GrenadeBounciness; internal static ConfigEntry<float> Lift; internal static ConfigEntry<float> Gravity; internal static ConfigEntry<float> GunShotDelay; internal static ConfigEntry<int> GunClipSize; private const string LaunchEvent = "MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeLaunch"; private const string DetonateEvent = "MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeDetonate"; private static uint nextId; internal static void Bind(ConfigFile config) { Speed = config.Bind<float>("Grenade Launcher", "LaunchSpeed", 30f, "Launch speed along the aim, m/s."); Lift = config.Bind<float>("Grenade Launcher", "LaunchLift", 5f, "Extra upward speed every grenade is thrown with, m/s - the lob."); Gravity = config.Bind<float>("Grenade Launcher", "Gravity", 18f, "Gravity on a grenade in flight, m/s2."); FuseSeconds = config.Bind<float>("Grenade Launcher", "FuseSeconds", 2.5f, "Seconds before a missed grenade explodes on its own (Quake 1: 2.5)."); BlastRadius = config.Bind<float>("Grenade Launcher", "BlastRadius", 5.2f, "Metres the blast reaches (Quake 1: 160 units)."); BlastDamage = config.Bind<float>("Grenade Launcher", "BlastDamage", 75f, "Damage at the blast's center."); BlastEdgeFraction = config.Bind<float>("Grenade Launcher", "BlastEdgeFraction", 0.33f, "Share of damage left at the blast's edge (Quake 1: a third)."); BlastStagger = config.Bind<float>("Grenade Launcher", "BlastStagger", 5f, "Blast stagger multiplier."); GrenadeBounciness = config.Bind<float>("Grenade Launcher", "GrenadeBounciness", 0.5f, "Speed kept per bounce off the world (Quake 1: half)."); GunShotDelay = config.Bind<float>("Grenade Launcher", "GunShotDelay", 0.6f, "Seconds between shots (semi-auto) - the Grenade Pistol and Rifle alike."); GunClipSize = config.Bind<int>("Grenade Launcher", "GunClipSize", 6, "Magazine size."); } internal static void Init() { RemoteEvents.Register("MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeLaunch", delegate(ulong _, LaunchMessage message) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) LauncherGrenade.Spawn(message.Id, null, new Vector3(message.X, message.Y, message.Z), new Vector3(message.VelX, message.VelY, message.VelZ)); }); RemoteEvents.Register("MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeDetonate", delegate(ulong _, DetonateMessage message) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) LauncherGrenade.Detonate(message.Id, new Vector3(message.X, message.Y, message.Z)); }); } internal static void Launch(PlayerAgent owner, Vector3 position, Vector3 aim, uint gearCategoryId) { //IL_0002: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = ((Vector3)(ref aim)).normalized * Speed.Value + Vector3.up * Lift.Value; SNet_Player owner2 = owner.Owner; uint id = (uint)(((owner2 != null) ? owner2.PlayerSlotIndex() : 0) << 24) | (++nextId & 0xFFFFFF); LauncherGrenade.Spawn(id, owner, position, velocity, gearCategoryId); NetworkAPI.InvokeEvent<LaunchMessage>("MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeLaunch", new LaunchMessage(id, position, velocity), (SNet_ChannelType)2); } internal static void SendDetonate(uint id, Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) NetworkAPI.InvokeEvent<DetonateMessage>("MindAttic.GTFO.EZ.AbsurdWeapons.GrenadeDetonate", new DetonateMessage(id, position), (SNet_ChannelType)2); } } internal sealed class LauncherGrenade : MonoBehaviour { private const float Radius = 0.12f; private const float RestSpeed = 1.2f; priva