Decompiled source of VoidGuns v0.5.2
plugins/VoidGuns.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; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BufferedEvents.Impacts; using CG; using CG.Client.Audio; using CG.Client.Combat; using CG.Client.Player.Input; using CG.Client.Player.Interactions; using CG.Client.Ship.Interactions; using CG.Client.UserData; using CG.Game; using CG.Game.Player; using CG.Game.SpaceObjects; using CG.GameLoopStateMachine; using CG.GameLoopStateMachine.GameStates; using CG.Graphics; using CG.Input; using CG.Network; using CG.Objects; using CG.Profile; using CG.Rewards; using CG.Server.Game.Loot; using CG.Ship.Hull; using CG.Ship.Modules; using CG.Ship.Object; using CG.Space; using Client.Player.Interactions; using ExitGames.Client.Photon; using FMOD; using FMOD.Studio; using FMODUnity; using Gameplay.Atmosphere; using Gameplay.Carryables; using Gameplay.CompositeWeapons; using Gameplay.CompositeWeapons.Effects; using Gameplay.Damage; using Gameplay.Hub; using Gameplay.Loot; using Gameplay.Power; using Gameplay.Quests; using Gameplay.SpacePlatforms; using Gameplay.Tags; using Gameplay.Utilities; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Opsive.Shared.Input; using Opsive.UltimateCharacterController.Camera; using Opsive.UltimateCharacterController.Character; using Opsive.UltimateCharacterController.Character.Abilities; using Opsive.UltimateCharacterController.Inventory; using Opsive.UltimateCharacterController.Items; using Opsive.UltimateCharacterController.Objects.CharacterAssist; using Opsive.UltimateCharacterController.Traits; using Photon.Pun; using Photon.Realtime; using ResourceAssets; using RuntimeAssets; using ToolClasses; using UI.Core; using UI.Core.Audio; using UI.Fabricator; using UI.MainHUD; using UI.ObjectMarker; using UI.Ping; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.LowLevel; using UnityEngine.PlayerLoop; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UIElements; using VFX; using VoidGuns.Content; using VoidManager; using VoidManager.Chat.Router; using VoidManager.CustomGUI; using VoidManager.MPModChecks; using VoidManager.ModMessages; using VoidManager.Utilities; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("NeoLorem")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Craftable hand-held blasters for on-foot combat (Void Crew).")] [assembly: AssemblyFileVersion("0.5.2.0")] [assembly: AssemblyInformationalVersion("0.5.2")] [assembly: AssemblyProduct("VoidGuns")] [assembly: AssemblyTitle("VoidGuns")] [assembly: AssemblyVersion("0.5.2.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 VoidGuns { public class GunsCommand : ChatCommand { private static GunDef Tuned { get { if (!((Object)(object)Blaster.HeldLocal != (Object)null)) { return GunDefs.Point; } return Blaster.HeldLocal.Def; } } public override string[] CommandAliases() { return new string[1] { "guns" }; } public override string Description() { return "Void Guns: give [pistol|rifle|sniper] (host), encounters reset, enemy [sentry|leaper|target] [count], enemy clear, ambush (host), unlock [on|off] (host), loot, shield medium|heavy|fill|off,pvp maps|arena|spawn|spawns|tp|unspawn, hold x y z, angle x y z, rhand x y z [rx ry rz], lhand x y z [rx ry rz], pose, debug"; } public override string[] UsageExamples() { return new string[18] { "/guns give", "/guns give rifle", "/guns give sniper", "/guns encounters reset", "/guns enemy", "/guns enemy sentry 3", "/guns enemy leaper 2", "/guns enemy target", "/guns ambush", "/guns enemy clear", "/guns shield medium", "/guns shield heavy", "/guns hold 0.15 0 0", "/guns angle 0 0 0", "/guns rhand 0.01 -0.07 -0.06", "/guns rhand 0.01 -0.07 -0.06 0 90 0", "/guns pose", "/guns debug" }; } public override void Execute(string arguments) { //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) string[] array = (arguments ?? string.Empty).Trim().ToLowerInvariant().Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); string text = ((array.Length != 0) ? array[0] : string.Empty); switch (text) { case "give": Messaging.Echo("/guns give: " + Give((array.Length > 1) ? array[1] : null), true); break; case "encounters": Messaging.Echo("/guns encounters: " + ((array.Length > 1 && array[1] == "reset") ? Encounters.Reset() : "use \"/guns encounters reset\" so stations can be defended again"), true); break; case "enemy": Messaging.Echo("/guns " + string.Join(" ", array) + ": " + EnemyCommand(array), true); break; case "pvp": Messaging.Echo("/guns pvp: " + PvpMaps.Command(array), true); break; case "unlock": Messaging.Echo("/guns unlock: " + GunsUnlocks.Command((array.Length > 1) ? array[1] : null), true); break; case "shield": Messaging.Echo("/guns shield: " + PersonalShield.Command((array.Length > 1) ? array[1] : null), true); break; case "loot": Messaging.Echo("/guns loot: " + GunsLoot.Coverage(), true); break; case "ambush": Messaging.Echo("/guns ambush: " + EvaAmbush.Force(), true); break; case "hold": Set(text, array, Tuned.HoldOffsetAdjust, null); break; case "angle": Set(text, array, Tuned.HoldAngle, null); break; case "rhand": Set(text, array, Tuned.RightHandPosition, Tuned.RightHandRotation); break; case "lhand": Set(text, array, Tuned.LeftHandPosition, Tuned.LeftHandRotation); break; case "pose": { GunDef tuned = Tuned; Messaging.Echo("/guns pose (" + tuned.Name + "): hold " + Format(tuned.HoldOffsetAdjust.Value) + " | angle " + Format(tuned.HoldAngle.Value) + " | rhand " + Format(tuned.RightHandPosition.Value) + " " + Format(tuned.RightHandRotation.Value) + " | lhand " + Format(tuned.LeftHandPosition.Value) + " " + Format(tuned.LeftHandRotation.Value), true); break; } case "debug": Plugin.DebugShots.Value = !Plugin.DebugShots.Value; ((BaseUnityPlugin)Plugin.Instance).Config.Save(); Messaging.Echo("/guns debug: shot logging " + (Plugin.DebugShots.Value ? "ON (see the BepInEx log)" : "OFF"), true); break; default: Messaging.Echo("/guns give [pistol|rifle|sniper] | encounters reset | enemy [sentry|leaper|target] [count] | enemy clear | ambush | unlock [on|off] | loot | pvp ... | hold x y z | angle x y z | rhand x y z [rx ry rz] | lhand x y z [rx ry rz] | pose | debug (settings: F5 > Void Guns)", true); break; } } private static string EnemyCommand(string[] parts) { if (parts.Length > 1 && parts[1] == "clear") { return Enemies.ClearAll(); } string text = ((parts.Length > 1) ? parts[1] : ""); EnemyKind kind = ((!text.StartsWith("target") && !text.StartsWith("dummy")) ? ((text.StartsWith("leap") || text.StartsWith("quad") || text.StartsWith("walker")) ? EnemyKind.QuadShell : ((text.StartsWith("titan") || text.StartsWith("trilo") || text.StartsWith("big")) ? EnemyKind.Titan : ((!text.StartsWith("troop") && !text.StartsWith("human") && !text.StartsWith("soldier")) ? EnemyKind.EyeDrone : EnemyKind.Trooper))) : EnemyKind.Sentry); int count = 1; for (int i = 0; i < parts.Length; i++) { if (int.TryParse(parts[i], out var result)) { count = result; } } return Enemies.SpawnInFront(kind, count); } private static void Set(string name, string[] parts, ConfigEntry<Vector3> position, ConfigEntry<Vector3> rotation) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (!TryParseVector(parts, 1, out var value)) { string text = Format(position.Value) + ((rotation != null) ? (" " + Format(rotation.Value)) : ""); Messaging.Echo("/guns " + name + " x y z" + ((rotation != null) ? " [rx ry rz]" : "") + " (now " + text + ")", true); } else { position.Value = value; string text2 = "/guns " + name + " set to " + Format(value); if (rotation != null && TryParseVector(parts, 4, out var value2)) { rotation.Value = value2; text2 = text2 + ", rotation " + Format(value2); } ((BaseUnityPlugin)Plugin.Instance).Config.Save(); Messaging.Echo(text2, true); } } private static string Format(Vector3 v) { //IL_000a: 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_0020: Unknown result type (might be due to invalid IL or missing references) return string.Format(CultureInfo.InvariantCulture, "{0:0.###} {1:0.###} {2:0.###}", v.x, v.y, v.z); } private static bool TryParseVector(string[] parts, int start, out Vector3 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) value = default(Vector3); if (parts.Length >= start + 3 && float.TryParse(parts[start], NumberStyles.Float, CultureInfo.InvariantCulture, out value.x) && float.TryParse(parts[start + 1], NumberStyles.Float, CultureInfo.InvariantCulture, out value.y)) { return float.TryParse(parts[start + 2], NumberStyles.Float, CultureInfo.InvariantCulture, out value.z); } return false; } internal static string Give(string which = null) { //IL_0243: 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_0253: 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_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return "host only"; } GunDef gunDef = ((which != null && (which.StartsWith("revolver") || which.StartsWith("kinetic") || which.StartsWith("bulwark") || which.StartsWith("confessor") || which.StartsWith("six"))) ? GunDefs.Revolver : ((which != null && (which.StartsWith("rampart") || which.StartsWith("litany") || which.StartsWith("ar6") || which.StartsWith("krifle") || which.StartsWith("k-rifle"))) ? GunDefs.RifleKinetic : ((which != null && (which.StartsWith("verdict") || which.StartsWith("benediction") || which.StartsWith("lance") || which.StartsWith("ksniper") || which.StartsWith("k-sniper"))) ? GunDefs.SniperKinetic : ((which != null && (which.StartsWith("rifle") || which.StartsWith("challenger") || which.StartsWith("ar4") || which.StartsWith("pdr") || which.StartsWith("shuriken"))) ? GunDefs.Rifle : ((which != null && (which.StartsWith("sniper") || which.StartsWith("longshot") || which.StartsWith("recuser") || which.StartsWith("longbow"))) ? GunDefs.Sniper : ((which != null && (which.StartsWith("grenade") || which.StartsWith("pulse") || which.StartsWith("nade"))) ? GunDefs.Grenade : GunDefs.Point)))))); if ((Object)(object)gunDef.Template == (Object)null) { return "the " + gunDef.Name + " isn't registered (see the BepInEx log)"; } LocalPlayer instance = LocalPlayer.Instance; if ((Object)(object)instance == (Object)null) { return "no player"; } Transform val = (((Object)(object)instance.CamControl != (Object)null) ? ((Component)instance.CamControl).transform : ((Component)instance).transform); Vector3 val2 = val.position + val.forward * 1.5f; ObjectFactory.InstantiateSpaceObjectByGUID(gunDef.Guid, val2, Quaternion.LookRotation(val.forward), (Dictionary<byte, object>)null); return gunDef.Name + " spawned in front of you"; } } internal class GunsSettings : ModSettingsMenu { private static GunDef selected; private static GunDef lastHeld; private static readonly string[] Tabs = new string[6] { "Guns", "PvP", "Enemies", "Ship & loot", "Effects", "Testing" }; private static int tab; private static bool showHold; public override string Name() { return "Void Guns"; } public override void OnClose() { ((BaseUnityPlugin)Plugin.Instance).Config.Save(); } public override void Draw() { tab = GUILayout.Toolbar(tab, Tabs, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }); GUILayout.Space(8f); switch (tab) { case 0: DrawGuns(); break; case 1: DrawPvp(); break; case 2: DrawEnemies(); break; case 3: DrawShip(); break; case 4: DrawEffects(); break; default: DrawTesting(); break; } } private static void Header(string text) { GUILayout.Space(6f); GUILayout.Label("<b>" + text + "</b>", Array.Empty<GUILayoutOption>()); } private static void DrawGuns() { //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) GunDef gunDef = (((Object)(object)Blaster.HeldLocal != (Object)null) ? Blaster.HeldLocal.Def : null); if (selected == null || gunDef != lastHeld) { lastHeld = gunDef; if (gunDef != null || selected == null) { selected = gunDef ?? GunDefs.Point; } } for (int i = 0; i * 3 < GunDefs.All.Count; i++) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); foreach (GunDef item in GunDefs.All.Skip(i * 3).Take(3)) { if (GUILayout.Toggle(selected == item, item.Name, GUI.skin.button, Array.Empty<GUILayoutOption>())) { selected = item; } } GUILayout.EndHorizontal(); } GunDef gunDef2 = selected; GUILayout.Label((gunDef2 == gunDef) ? (gunDef2.Name + " (in your hands)") : (gunDef2.Name + " (hold it to see hand changes)"), Array.Empty<GUILayoutOption>()); if (gunDef2.Thrown) { Header("Throwing"); Slider("Damage at the centre of the blast", gunDef2.Damage, 1f, 500f, "0"); Slider("Blast radius (m)", gunDef2.BlastRadius, 1f, 20f, "0.0"); Slider("Fuse (s)", gunDef2.FuseTime, 0.3f, 6f, "0.0"); Slider("Throw speed (m/s)", gunDef2.ThrowSpeed, 3f, 40f, "0.0"); Slider("Throws per second (max)", gunDef2.FireRate, 0.2f, 4f, "0.0"); Slider("Grenades per charge", gunDef2.BatteryShots, 1f, 30f, "0"); Slider("PvP hit at the centre (share of health)", gunDef2.PvpDamage, 0f, 2f, "0.00"); Slider("Cooldown after a throw (s)", gunDef2.Cooldown, 0f, 60f, "0"); } else { Header("Firing"); Slider("Damage per shot", gunDef2.Damage, 1f, 200f, "0"); Toggle("Semi-automatic (one shot per click)", gunDef2.SemiAuto); Slider("Fire rate (shots/s, max)", gunDef2.FireRate, 0.5f, 20f, "0.0"); Slider("Range (m)", gunDef2.Range, 20f, 1500f, "0"); Slider("Full damage up to (m)", gunDef2.FalloffStart, 0f, 1000f, "0"); Slider("No damage beyond (m)", gunDef2.FalloffEnd, 5f, 1500f, "0"); if (gunDef2.PvpDamage != null) { Slider("PvP hit (share of a player's health)", gunDef2.PvpDamage, 0f, 1f, "0.00"); } Header("Accuracy"); Slider("Spread when steady (degrees)", gunDef2.BaseSpread, 0f, 5f, "0.00"); Slider("Spread added per shot", gunDef2.SpreadPerShot, 0f, 3f, "0.00"); Slider("Most spread (degrees)", gunDef2.MaxSpread, 0f, 10f, "0.0"); Slider("Accuracy recovery per second", gunDef2.SpreadRecovery, 0.2f, 15f, "0.0"); Slider("Aim: spread (share of hip fire)", gunDef2.AdsSpread, 0f, 1f, "0.00"); if (gunDef2.Kinetic) { Header("Magazine"); IntSlider("Rounds per magazine", gunDef2.MagazineSize, 1, 100); Slider("Reload time (s)", gunDef2.ReloadTime, 0.3f, 6f, "0.0"); Slider("Kick", gunDef2.Recoil, 0f, 6f, "0.0"); } else { Header("Heat"); Slider("Shots to overheat", gunDef2.OverheatShots, 3f, 60f, "0"); Slider("Cooling per second (share of the bar)", gunDef2.CoolRate, 0.05f, 3f, "0.00"); Slider("Cooling starts after (s)", gunDef2.CoolDelay, 0f, 2f, "0.00"); Slider("Overheat vent time (s)", gunDef2.OverheatVentTime, 0.2f, 8f, "0.0"); } } Header("Sound and cost"); Slider("Shot pitch", gunDef2.ShotPitch, 0.25f, 4f, "0.00"); Slider("Shot volume", gunDef2.ShotVolume, 0f, 2f, "0.00"); IntSlider("Alloy cost (next start)", gunDef2.AlloyCost, 0, 500); GUILayout.Space(6f); showHold = GUILayout.Toggle(showHold, showHold ? " Hide aim and hold pose" : " Show aim and hold pose (advanced)", Array.Empty<GUILayoutOption>()); if (showHold) { Slider("Aim: distance from the eye (m)", gunDef2.AdsDistance, 0.1f, 0.7f, "0.000"); Slider("Aim: sight height above the grip (m)", gunDef2.AdsSightHeight, 0f, 0.25f, "0.000"); GUILayout.Label("Gun space: x right, y up, z forward; metres and degrees", Array.Empty<GUILayoutOption>()); Vector("Gun position (added to the carry point)", gunDef2.HoldOffsetAdjust, -0.6f, 0.6f, "0.000"); Vector("Gun angle", gunDef2.HoldAngle, -180f, 180f, "0"); Vector("Right wrist position", gunDef2.RightHandPosition, -0.3f, 0.3f, "0.000"); Vector("Right hand rotation", gunDef2.RightHandRotation, -180f, 180f, "0"); Vector("Left wrist position", gunDef2.LeftHandPosition, -0.4f, 0.4f, "0.000"); Vector("Left hand rotation", gunDef2.LeftHandRotation, -180f, 180f, "0"); Vector("Sprint gun offset", gunDef2.SprintOffset, -0.4f, 0.4f, "0.000"); Vector("Sprint gun angle", gunDef2.SprintAngle, -90f, 90f, "0"); if (gunDef2.RedDot != null) { Vector("Red dot position", gunDef2.RedDot, -0.3f, 0.3f, "0.0000"); } } Header("All guns"); Toggle("Show the heat bar", Plugin.HeatBarShown); Toggle("Show the controls above the ammo", ControlsHud.Show); Toggle("Hide the game's item panel while holding a gun", Plugin.HideCarryPanel); Slider("Aim: time to raise (s)", Plugin.AdsTime, 0.02f, 0.6f, "0.00"); Slider("Aim: push out on ultrawide", Plugin.WideAimPush, 0f, 2f, "0.00"); Slider("Sprint-to-fire time (s)", Plugin.SprintToFire, 0f, 1f, "0.00"); Slider("Lag behind quick turns", Plugin.TurnSway, 0f, 3f, "0.00"); Slider("Idle sway", Plugin.IdleSway, 0f, 4f, "0.00"); Slider("Step sway", Plugin.SprintBob, 0f, 3f, "0.00"); GUILayout.Label($"Keys: holster {Plugin.HolsterKey.Value}, drop {Plugin.DropKey.Value}, reload {Plugin.ReloadKey.Value} (change them in the config file)", Array.Empty<GUILayoutOption>()); } private static void DrawPvp() { //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) Header("Match"); IntSlider("Kills to win (Free For All)", PvpScore.KillLimit, 1, 100); IntSlider("Team kills to win (Team Deathmatch)", PvpTeams.TeamKillLimit, 1, 200); Slider("Time limit (s)", PvpScore.TimeLimit, 60f, 1800f, "0"); Slider("Class pick time (s)", PvpPhase.PickSeconds, 5f, 60f, "0"); Slider("Start countdown (s)", PvpPhase.CountdownSeconds, 0f, 15f, "0"); Slider("Start song volume", PvpCountdown.StartSongVolume, 0f, 3f, "0.00"); Slider("Spawn protection (s)", PvpClasses.ProtectionSeconds, 0f, 10f, "0.0"); Slider("Jetpack flying speed", PvpMovement.FlightSpeed, 0.5f, 3f, "0.00"); Toggle("Use my Engineer skill tree during matches", PvpLoadout.Engineer); Header("Search & Destroy"); IntSlider("Round wins to take the match", PvpBomb.RoundsToWin, 1, 10); IntSlider("Round wins needed in overtime (at one short each)", PvpBomb.OvertimeWins, 1, 12); Slider("Bomb timer (s)", PvpBomb.BombTimer, 5f, 120f, "0"); Slider("Round time to plant (s)", PvpBomb.RoundTime, 30f, 600f, "0"); Slider("Hold before a round (s)", PvpBomb.PrepSeconds, 0f, 20f, "0"); Slider("Plant time (s)", PvpBomb.PlantSeconds, 0.5f, 15f, "0.0"); Slider("Defuse time (s)", PvpBomb.DefuseSeconds, 0.5f, 20f, "0.0"); Slider("Arena circle radius (m)", PvpBomb.ArenaRadius, 100f, 600f, "0"); Header("Arena"); Slider("Team arenas apart (m)", PvpWalls.TeamArenaDistance, 150f, 600f, "0"); Slider("Wall room at the sides (m)", PvpWalls.SideMargin, 0f, 60f, "0"); Slider("Wall room above (m)", PvpWalls.TopMargin, 0f, 80f, "0"); Slider("Floor under the arena (m)", PvpWalls.FloorMargin, 0f, 20f, "0"); Header("Damage to players (energy guns; kinetic guns are on the Guns page)"); Slider("Point Blaster hit", PvpScore.PistolDamage, 0f, 1f, "0.00"); Slider("Shuriken PDR hit", PvpScore.RifleDamage, 0f, 1f, "0.00"); Slider("Recuser Longbow hit", PvpScore.SniperDamage, 0f, 1f, "0.00"); GUILayout.Label($"Keys: class picker {PvpClasses.ClassKey.Value}, scoreboard {PvpHud.ScoreboardKey.Value}, plant/defuse {PvpBomb.BombKey.Value}", Array.Empty<GUILayoutOption>()); } private static void DrawEnemies() { Header("Station encounters (boarding a station or derelict)"); Toggle("Stations are defended", Plugin.EncountersEnabled); Slider("Chance a station is defended", Plugin.EncounterChance, 0f, 1f, "0.00"); Slider("Defenders (solo)", Plugin.EncounterDefenders, 0f, 12f, "0"); Slider("Total enemies incl. waves (solo)", Plugin.EncounterTotal, 1f, 30f, "0"); Slider("Extra per additional player", Plugin.EncounterPerExtraPlayer, 0f, 1.5f, "0.00"); Slider("Seconds before the next wave anyway", Plugin.EncounterWaveInterval, 5f, 120f, "0"); Slider("Alarm volume", Plugin.AlarmVolume, 0f, 2f, "0.00"); if (GUILayout.Button("Reset encounters (stations can be defended again)", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Encounters.Reset(), true); } Header("HOLLOW Titan"); Slider("Health", TitanSettings.Health, 50f, 3000f, "0"); Slider("Speed (m/s)", TitanSettings.Speed, 0.5f, 6f, "0.0"); Slider("Laser range (m)", TitanSettings.LaserRange, 5f, 80f, "0"); Slider("Laser warning (s)", TitanSettings.LaserWindup, 0.1f, 3f, "0.0"); Slider("Laser duration (s)", TitanSettings.LaserDuration, 0.5f, 8f, "0.0"); Slider("Laser sweep (degrees)", TitanSettings.LaserSweep, 0f, 180f, "0"); Slider("Laser damage per second (share)", TitanSettings.LaserDamage, 0f, 1f, "0.00"); Slider("Time between beams (s)", TitanSettings.LaserCooldown, 2f, 30f, "0.0"); Slider("Strike range (m)", TitanSettings.MeleeRange, 1f, 8f, "0.0"); Slider("Strike damage (share)", TitanSettings.MeleeDamage, 0f, 1f, "0.00"); Slider("Share of encounter enemies", TitanSettings.Share, 0f, 1f, "0.00"); Header("HOLLOW Trooper"); Slider("Health", TrooperSettings.Health, 20f, 1000f, "0"); Slider("Speed (m/s)", TrooperSettings.Speed, 0.5f, 8f, "0.0"); Slider("Fire range (m)", TrooperSettings.FireRange, 3f, 60f, "0"); Slider("Bolt damage (share)", TrooperSettings.Damage, 0f, 0.5f, "0.00"); Slider("Aim error (degrees)", TrooperSettings.Spread, 0f, 15f, "0.0"); IntSlider("Shots per burst", TrooperSettings.Burst, 1, 10); IntSlider("Shots before venting", TrooperSettings.Magazine, 1, 60); Slider("Thruster and vent volume", TrooperSettings.BoostVolume, 0f, 3f, "0.00"); Slider("Voice volume", TrooperSettings.VoiceVolume, 0f, 3f, "0.00"); Slider("Seconds between its noises (0 = none)", TrooperSettings.NoiseInterval, 0f, 60f, "0"); Slider("Bash damage (share)", TrooperSettings.MeleeDamage, 0f, 1f, "0.00"); Slider("Boost aside chance when shot", TrooperSettings.DashChance, 0f, 1f, "0.00"); Slider("Flying speed (m/s)", TrooperSettings.FlySpeed, 1f, 20f, "0.0"); Slider("Takes off after players in space beyond (m)", TrooperSettings.FlyDistance, 2f, 60f, "0"); Slider("Share of encounter enemies", TrooperSettings.Share, 0f, 1f, "0.00"); Header("HOLLOW Sentry"); Slider("Health", Plugin.DroneHealth, 5f, 500f, "0"); Slider("Speed (m/s)", Plugin.DroneSpeed, 0.5f, 15f, "0.0"); Slider("Aggro range (m)", Plugin.DroneAggroRange, 5f, 100f, "0"); Slider("Attack range (m)", Plugin.DroneAttackRange, 3f, 60f, "0"); Slider("Time between shots (s)", Plugin.DroneFireCooldown, 0.3f, 10f, "0.0"); Slider("Bolt speed (m/s)", Plugin.DroneBoltSpeed, 5f, 100f, "0"); Slider("Damage (share of max health)", Plugin.DroneDamage, 0f, 1f, "0.00"); Slider("Shot volume", Plugin.DroneShotVolume, 0f, 3f, "0.00"); Slider("Hum volume", Plugin.DroneHumVolume, 0f, 2f, "0.00"); Slider("Hum boost in a suit", Plugin.DroneHumSuitBoost, 1f, 6f, "0.0"); } private static void DrawShip() { Header("Gun Charging Station (Fabricator, Utility tab; lootable)"); Toggle("Unlock everything from the start (the host's setting applies to all)", Plugin.UnlockAll); Slider("Drop chance vs the battery charge station", Plugin.StationDropChance, 0f, 5f, "0.00"); Slider("Charge time, empty to full (s)", GunCharger.ChargeTime, 5f, 120f, "0"); Header("Drops from enemies"); IntSlider("Fewest alloys per kill", Plugin.AlloyMin, 0, 20); IntSlider("Most alloys per kill", Plugin.AlloyMax, 0, 20); Slider("Weapon drop chance", Plugin.WeaponDropChance, 0f, 1f, "0.00"); Slider("Of those, rifles", Plugin.RifleDropShare, 0f, 1f, "0.00"); Slider("Alloy pull range (m)", Plugin.MagnetRange, 0f, 15f, "0.0"); } private static void DrawEffects() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) Header("Sound"); Slider("Volume", Plugin.Volume, 0f, 2f, "0.00"); Slider("Louder while wearing a jetpack", Plugin.JetpackVolumeBoost, 1f, 3f, "0.00"); Toggle("Energy gatling shot sound", Plugin.GatlingSound); Header("Shots"); Slider("Energy bolt width (m)", Plugin.TracerWidth, 0.005f, 0.2f, "0.000"); Color value = Plugin.TracerColor.Value; float num = Channel("Bolt red", value.r); float num2 = Channel("Bolt green", value.g); float num3 = Channel("Bolt blue", value.b); if (num != value.r || num2 != value.g || num3 != value.b) { Plugin.TracerColor.Value = new Color(num, num2, num3, 1f); } Slider("Kinetic round speed (m/s)", Plugin.KineticRoundSpeed, 50f, 2000f, "0"); Slider("Kinetic round streak length", Plugin.KineticRoundStretch, 1f, 8f, "0.0"); } private static void DrawTesting() { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Spawn HOLLOW Sentry", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.SpawnInFront(EnemyKind.EyeDrone), true); } if (GUILayout.Button("Spawn HOLLOW Leaper", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.SpawnInFront(EnemyKind.QuadShell), true); } if (GUILayout.Button("Spawn HOLLOW Titan", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.SpawnInFront(EnemyKind.Titan), true); } if (GUILayout.Button("Spawn HOLLOW Trooper", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.SpawnInFront(EnemyKind.Trooper), true); } if (GUILayout.Button("Spawn test target", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.SpawnInFront(EnemyKind.Sentry), true); } if (GUILayout.Button("Clear enemies", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + Enemies.ClearAll(), true); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); string[] array = new string[6] { "pistol", "rifle", "sniper", "revolver", "ar6", "benediction" }; foreach (string text in array) { if (GUILayout.Button("Give " + text + " (host)", Array.Empty<GUILayoutOption>())) { Messaging.Echo("Void Guns: " + GunsCommand.Give(text), true); } } GUILayout.EndHorizontal(); Slider("Test target health", Plugin.EnemyHealth, 10f, 1000f, "0"); Slider("Spawn distance (m)", Plugin.EnemySpawnDistance, 1.5f, 20f, "0.0"); Toggle("Log every shot and enemy hit (BepInEx log)", Plugin.DebugShots); if (GUILayout.Button("Re-learn the grip (then stand still a moment)", Array.Empty<GUILayoutOption>())) { GunArms.Relearn(); } } private static void Toggle(string label, ConfigEntry<bool> entry) { bool flag = GUILayout.Toggle(entry.Value, " " + label, Array.Empty<GUILayoutOption>()); if (flag != entry.Value) { entry.Value = flag; } } private static void Slider(string label, ConfigEntry<float> entry, float min, float max, string format) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(label + ": " + entry.Value.ToString(format, CultureInfo.InvariantCulture), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) }); float num = GUILayout.HorizontalSlider(entry.Value, min, max, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) }); if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { num = (float)((ConfigEntryBase)entry).DefaultValue; } GUILayout.EndHorizontal(); if (Mathf.Abs(num - entry.Value) > 0.0001f) { entry.Value = num; } } private static void IntSlider(string label, ConfigEntry<int> entry, int min, int max) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"{label}: {entry.Value}", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) }); int num = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)entry.Value, (float)min, (float)max, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) })); if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { num = (int)((ConfigEntryBase)entry).DefaultValue; } GUILayout.EndHorizontal(); if (num != entry.Value) { entry.Value = num; } } private static void Vector(string label, ConfigEntry<Vector3> entry, float min, float max, string format) { //IL_0001: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00aa: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) Vector3 value = entry.Value; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(label + ": " + value.x.ToString(format, CultureInfo.InvariantCulture) + ", " + value.y.ToString(format, CultureInfo.InvariantCulture) + ", " + value.z.ToString(format, CultureInfo.InvariantCulture), Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { entry.Value = (Vector3)((ConfigEntryBase)entry).DefaultValue; GUILayout.EndHorizontal(); return; } GUILayout.EndHorizontal(); float num = Axis("x", value.x, min, max); float num2 = Axis("y", value.y, min, max); float num3 = Axis("z", value.z, min, max); if (num != value.x || num2 != value.y || num3 != value.z) { entry.Value = new Vector3(num, num2, num3); } } private static float Axis(string name, float value, float min, float max) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(" " + name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); float num = GUILayout.HorizontalSlider(value, min, max, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(300f) }); GUILayout.EndHorizontal(); if (!(Mathf.Abs(num - value) > 1E-05f)) { return value; } return num; } private static float Channel(string label, float value) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"{label}: {value:0.00}", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) }); float num = GUILayout.HorizontalSlider(value, 0f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) }); GUILayout.EndHorizontal(); if (!(Mathf.Abs(num - value) > 0.0001f)) { return value; } return num; } } internal static class MyPluginInfo { public const string GUID = "VoidGuns"; public const string Name = "Void Guns"; public const string Version = "0.5.2"; } [BepInPlugin("VoidGuns", "Void Guns", "0.5.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; internal static Plugin Instance; internal static string PluginDir; internal static bool HideOverlay; internal static ConfigEntry<float> Damage; internal static ConfigEntry<bool> SemiAuto; internal static ConfigEntry<float> FireRate; internal static ConfigEntry<float> Range; internal static ConfigEntry<int> AlloyCost; internal static ConfigEntry<string> BaseCarryable; internal static ConfigEntry<Vector3> HoldOffsetAdjust; internal static ConfigEntry<Vector3> HoldAngle; internal static ConfigEntry<bool> HandIK; internal static ConfigEntry<Vector3> RightHandPosition; internal static ConfigEntry<Vector3> RightHandRotation; internal static ConfigEntry<Vector3> LeftHandPosition; internal static ConfigEntry<Vector3> LeftHandRotation; internal static ConfigEntry<bool> FollowViewPitch; internal static ConfigEntry<float> FalloffStart; internal static ConfigEntry<float> FalloffEnd; internal static ConfigEntry<float> OverheatShots; internal static ConfigEntry<float> CoolRate; internal static ConfigEntry<float> CoolDelay; internal static ConfigEntry<float> OverheatVentTime; internal static ConfigEntry<bool> HeatBarShown; internal static ConfigEntry<bool> HideCarryPanel; internal static ConfigEntry<float> AdsTime; internal static ConfigEntry<float> WideAimPush; internal static ConfigEntry<float> AdsDistance; internal static ConfigEntry<float> AdsSightHeight; internal static ConfigEntry<float> AdsSpread; internal static ConfigEntry<Key> DropKey; internal static ConfigEntry<Key> HolsterKey; internal static ConfigEntry<Key> ReloadKey; internal static ConfigEntry<float> BaseSpread; internal static ConfigEntry<float> SpreadPerShot; internal static ConfigEntry<float> MaxSpread; internal static ConfigEntry<float> SpreadRecovery; internal static ConfigEntry<float> IdleSway; internal static ConfigEntry<float> HeatSway; internal static ConfigEntry<float> FingerCurl; internal static ConfigEntry<float> SupportFingerCurl; internal static ConfigEntry<float> DroneGravityHeight; internal static ConfigEntry<float> DroneGravityRange; internal static ConfigEntry<bool> ArmIK; internal static ConfigEntry<float> SteadyShoulders; internal static ConfigEntry<float> SteadyElbows; internal static ConfigEntry<float> TurnSway; internal static ConfigEntry<bool> GatlingSound; internal static ConfigEntry<float> JetpackVolumeBoost; internal static ConfigEntry<float> DroneHumSuitBoost; internal static ConfigEntry<float> KineticRoundScale; internal static ConfigEntry<float> KineticRoundSpeed; internal static ConfigEntry<float> KineticRoundStretch; internal static ConfigEntry<float> ShotPitch; internal static ConfigEntry<float> ShotVolume; internal static ConfigEntry<float> ImpactVolume; internal static ConfigEntry<float> ImpactRange; internal static ConfigEntry<string> DroneHumEvent; internal static ConfigEntry<Vector3> SprintOffset; internal static ConfigEntry<Vector3> SprintAngle; internal static ConfigEntry<float> SprintBob; internal static ConfigEntry<float> SprintToFire; internal static ConfigEntry<Color> TracerColor; internal static ConfigEntry<float> TracerWidth; internal static ConfigEntry<float> Volume; internal static ConfigEntry<bool> DebugShots; internal static ConfigEntry<float> EnemyHealth; internal static ConfigEntry<float> EnemySpawnDistance; internal static ConfigEntry<bool> EncountersEnabled; internal static ConfigEntry<float> EncounterChance; internal static ConfigEntry<float> EncounterDefenders; internal static ConfigEntry<float> EncounterTotal; internal static ConfigEntry<float> EncounterPerExtraPlayer; internal static ConfigEntry<float> EncounterWaveInterval; internal static ConfigEntry<float> EncounterAbandonRange; internal static ConfigEntry<float> EncounterAbandonTime; internal static ConfigEntry<float> AlarmVolume; internal static ConfigEntry<string> AlarmEvent; internal static ConfigEntry<int> AlloyMin; internal static ConfigEntry<int> AlloyMax; internal static ConfigEntry<float> BigWeaponDropChance; internal static ConfigEntry<float> WeaponDropChance; internal static ConfigEntry<float> PickupLifetime; internal static ConfigEntry<float> AlloyScale; internal static ConfigEntry<float> RifleDropShare; internal static ConfigEntry<float> SniperDropShare; internal static ConfigEntry<bool> UnlockAll; internal static ConfigEntry<int> StationFromTier; internal static ConfigEntry<float> StationDropChance; internal static ConfigEntry<bool> HollowColors; internal static ConfigEntry<float> ShipWeaponDamage; internal static ConfigEntry<Color> EnemyGlowColor; internal static ConfigEntry<Color> EnemyHullTint; internal static ConfigEntry<float> AlloyGlow; internal static ConfigEntry<float> MagnetRange; internal static ConfigEntry<float> CollectRange; internal static ConfigEntry<float> DroneHealth; internal static ConfigEntry<float> DroneScale; internal static ConfigEntry<float> DroneSpeed; internal static ConfigEntry<float> DroneAggroRange; internal static ConfigEntry<float> DroneAttackRange; internal static ConfigEntry<float> DronePreferredRange; internal static ConfigEntry<float> DroneWanderRadius; internal static ConfigEntry<float> DroneChargeTime; internal static ConfigEntry<float> DroneFireCooldown; internal static ConfigEntry<float> DroneBoltSpeed; internal static ConfigEntry<float> DroneDamage; internal static ConfigEntry<float> DroneShotVolume; internal static ConfigEntry<float> DroneHumVolume; internal static ConfigEntry<float> DroneHumPitch; internal static ConfigEntry<float> DroneHumRange; private float nextLoopCheck; private static string FindAssetDir(string dllDir) { if (File.Exists(Path.Combine(dllDir, "Guns", "point", "gun.json"))) { return dllDir; } List<string> list = new List<string> { Paths.PluginPath }; string text = Directory.GetParent(Paths.BepInExRootPath)?.FullName; if (text != null) { list.Add(text); } foreach (string item in list) { try { string[] files = Directory.GetFiles(item, "gun.json", SearchOption.AllDirectories); for (int i = 0; i < files.Length; i++) { DirectoryInfo parent = Directory.GetParent(files[i]); if (parent?.Name == "point" && parent.Parent?.Name == "Guns" && parent.Parent.Parent != null) { Log.LogWarning((object)("Void Guns: the gun files aren't next to the DLL (" + dllDir + "); using " + parent.Parent.Parent.FullName)); return parent.Parent.Parent.FullName; } } } catch (Exception ex) { Log.LogWarning((object)("Void Guns: searching " + item + " for the gun files failed: " + ex.Message)); } } Log.LogError((object)("Void Guns: no Guns folder found (looked next to " + dllDir + ", in " + Paths.PluginPath + " and the whole profile); guns won't load")); return dllDir; } private void Update() { Enemies.HostUpdate(); PersonalShield.Update(); Encounters.Update(); EvaAmbush.Update(); StarterGuns.Update(); GunsUnlocks.Update(); GunCharger.Update(); PvpMaps.Update(); PvpMatch.Update(); PvpClasses.Update(); PvpSession.Update(); PvpMovement.Update(); PvpPlayerMarks.Update(); PvpScore.Update(); PvpPhase.Update(); PvpBomb.Update(); PvpNoGlow.Update(); Holster.Update(); if (Time.unscaledTime >= nextLoopCheck) { nextLoopCheck = Time.unscaledTime + 5f; AfterLateUpdate.Ensure(); } } private void LateUpdate() { HudTweaks.LateUpdate(); HolsterVisuals.LateUpdate(); } private void OnGUI() { if (HideOverlay) { return; } if (PvpEnd.Active) { PvpEnd.Draw(); return; } PvpLoading.Draw(); if (!PvpLoading.Active) { ScopeView.Draw(); AmmoHud.Draw(); AmmoHud.DrawGrenade(); PersonalShield.Draw(); PvpBanner.Draw(); PvpClasses.Draw(); PvpProtection.Draw(); PvpScore.Draw(); PvpCountdown.Draw(); PvpBomb.Draw(); ControlsHud.Draw(); PvpHud.DrawScoreboard(); PvpEnd.Draw(); HeatBar.Draw(); AlertBanner.Draw(); } } private void Awake() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Expected O, but got Unknown //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Expected O, but got Unknown //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Expected O, but got Unknown //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Expected O, but got Unknown //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Expected O, but got Unknown //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Expected O, but got Unknown //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Expected O, but got Unknown //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Expected O, but got Unknown //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Expected O, but got Unknown //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Expected O, but got Unknown //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09b0: Expected O, but got Unknown //IL_0a07: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Expected O, but got Unknown //IL_0aa8: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Expected O, but got Unknown //IL_0bbd: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Expected O, but got Unknown //IL_0c5e: Unknown result type (might be due to invalid IL or missing references) //IL_0c68: Expected O, but got Unknown //IL_0c9b: Unknown result type (might be due to invalid IL or missing references) //IL_0ca5: Expected O, but got Unknown //IL_0cd8: Unknown result type (might be due to invalid IL or missing references) //IL_0ce2: Expected O, but got Unknown //IL_0d15: Unknown result type (might be due to invalid IL or missing references) //IL_0d1f: Expected O, but got Unknown //IL_0f6e: Unknown result type (might be due to invalid IL or missing references) //IL_0f78: Expected O, but got Unknown //IL_0fab: Unknown result type (might be due to invalid IL or missing references) //IL_0fb5: Expected O, but got Unknown //IL_100c: Unknown result type (might be due to invalid IL or missing references) //IL_1016: Expected O, but got Unknown //IL_106d: Unknown result type (might be due to invalid IL or missing references) //IL_1077: Expected O, but got Unknown //IL_10aa: Unknown result type (might be due to invalid IL or missing references) //IL_10b4: Expected O, but got Unknown //IL_116e: Unknown result type (might be due to invalid IL or missing references) //IL_11ca: Unknown result type (might be due to invalid IL or missing references) //IL_12fc: Unknown result type (might be due to invalid IL or missing references) //IL_1306: Expected O, but got Unknown //IL_135e: Unknown result type (might be due to invalid IL or missing references) //IL_1364: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Instance = this; PluginDir = FindAssetDir(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); Damage = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "Damage", 20f, "Damage per shot, before the target's defence type is applied."); SemiAuto = ((BaseUnityPlugin)this).Config.Bind<bool>("Blaster", "SemiAuto", true, "One shot per click. Off: fires continuously while the trigger is held."); FireRate = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "FireRate", 6f, new ConfigDescription("Most shots per second (semi-auto: the fastest you can click; otherwise the rate while held).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 20f), Array.Empty<object>())); Range = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "Range", 400f, "Range in metres."); FalloffStart = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "FalloffStart", 10f, "Full damage up to this distance (m)..."); FalloffEnd = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "FalloffEnd", 50f, "...falling off to no damage at this distance (m)."); OverheatShots = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "OverheatShots", 8f, "Shots in quick succession that overheat the gun."); CoolRate = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "CoolRate", 0.5f, "Heat lost per second (of the full bar) while not firing."); CoolDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "CoolDelay", 0.35f, "Seconds after a shot before the gun starts cooling."); OverheatVentTime = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "OverheatVentTime", 2f, "Seconds an overheated gun takes to vent before it fires again."); HideCarryPanel = ((BaseUnityPlugin)this).Config.Bind<bool>("Blaster", "HideCarryPanel", true, "Hide the game's carried-item panel (bottom right: item card and Drop/Throw keys) while holding a blaster."); HeatBarShown = ((BaseUnityPlugin)this).Config.Bind<bool>("Blaster", "HeatBar", true, "Show the heat bar under the crosshair while holding a blaster."); AdsTime = ((BaseUnityPlugin)this).Config.Bind<float>("Aim", "AdsTime", 0.15f, "Seconds to bring the gun up to the sights (right click)."); AdsDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Aim", "AdsDistance", 0.3f, "How far in front of the eye the gun sits when aiming (m)."); WideAimPush = ((BaseUnityPlugin)this).Config.Bind<float>("Aim", "WideScreenPush", 0.8f, "On screens wider than 16:9 (ultrawide), how much further out an aimed gun sits, so its back end and the hands don't clip into the view's wider sides: 0.8 puts it 27% further out at 21:9, 80% at 32:9. 0 = as on 16:9."); AdsSightHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Aim", "AdsSightHeight", 0.115f, "Height of the gun's sight line above its grip (m): it's lined up with the eye."); AdsSpread = ((BaseUnityPlugin)this).Config.Bind<float>("Aim", "AdsSpread", 0.4f, "Spread while aiming, as a share of the hip-fire spread."); DropKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "DropKey", (Key)31, "Key that drops a held weapon (right click aims instead of throwing)."); BaseSpread = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "BaseSpread", 0.15f, "Shot spread when the gun is cool (degrees, cone half-angle)."); SpreadPerShot = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "SpreadPerShot", 0.5f, "Extra spread per unit of heat (each shot adds 1 heat)."); MaxSpread = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "MaxSpread", 3.5f, "The most spread rapid fire can build up (degrees)."); SpreadRecovery = ((BaseUnityPlugin)this).Config.Bind<float>("Blaster", "SpreadRecovery", 5f, "Heat lost per second (how fast accuracy comes back)."); IdleSway = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "IdleSway", 1f, new ConfigDescription("Slight breathing sway of the held gun (0 = none).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 4f), Array.Empty<object>())); HeatSway = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "HeatSway", 0.6f, new ConfigDescription("How much each unit of heat (rapid fire) adds to the sway.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); FingerCurl = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "FingerCurl", 0.6f, new ConfigDescription("How far the right hand's fingers close around the grip.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>())); SupportFingerCurl = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "SupportFingerCurl", 0.45f, new ConfigDescription("How far the left hand's fingers close.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>())); DroneGravityHeight = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "GravityHeight", -0.3f, "In gravity (aboard), the height it holds relative to its target's chest (m). In zero-g it keeps 0.8 m above."); DroneGravityRange = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "GravityRange", 12f, "In gravity (aboard), the distance (m) it keeps from its target."); AlloyCost = ((BaseUnityPlugin)this).Config.Bind<int>("Blaster", "AlloyCost", 15, "Alloys to fabricate one. Applies on the next game start."); BaseCarryable = ((BaseUnityPlugin)this).Config.Bind<string>("Blaster", "BaseCarryable", "", "Name (or part of it) of the vanilla carryable the blaster is built on: it gives the carry behaviour, collider and network setup. Empty: picked automatically (the candidates are listed in the log). Applies on the next game start."); HoldOffsetAdjust = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "HoldOffsetAdjust", new Vector3(0.15f, 0.0594f, 0.017f), "Added to the base carryable's carrying offset (right, up, forward in metres, relative to the carry point). Live: \"/guns hold x y z\"."); HoldAngle = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "HoldAngle", Vector3.zero, "Rotation of the held blaster (degrees). Live: \"/guns angle x y z\"."); HandIK = ((BaseUnityPlugin)this).Config.Bind<bool>("Hold", "HandIK", true, "Put the hands on the blaster's grip (moves the base carryable's hand targets). Applies on the next game start."); RightHandPosition = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "RightHandPosition", new Vector3(0.0829f, -0.0162f, -0.063f), "Right wrist, in the gun's space (metres: x right, y up, z forward, from the top of the grip). Live: \"/guns rhand x y z [rx ry rz]\"."); RightHandRotation = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "RightHandRotation", Vector3.zero, "Extra rotation of the right hand (degrees), on top of the base item's carrying hand."); LeftHandPosition = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "LeftHandPosition", new Vector3(-0.0594f, -0.0241f, -0.1864f), "Left (support) wrist, in the gun's space. Live: \"/guns lhand x y z [rx ry rz]\"."); LeftHandRotation = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Hold", "LeftHandRotation", new Vector3(-61.98f, -22.92f, 22.5f), "Extra rotation of the left hand (degrees)."); FollowViewPitch = ((BaseUnityPlugin)this).Config.Bind<bool>("Hold", "FollowViewPitch", true, "The gun tilts with the view when looking up or down (else it stays level with the body)."); ArmIK = ((BaseUnityPlugin)this).Config.Bind<bool>("Hold", "ArmIK", true, "The arms follow the gun: after a moment standing still the grip is learned, then both hands are held on it."); SteadyShoulders = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "SteadyShoulders", 1f, new ConfigDescription("How much the shoulders are held where they sit when standing with the gun (1 = still, 0 = the walk/run animation's swing).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); SteadyElbows = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "SteadyElbows", 1f, new ConfigDescription("How much the elbows keep the bend learned with the grip (1 = they move only with the gun, 0 = they swing with the walk/look animations).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); TurnSway = ((BaseUnityPlugin)this).Config.Bind<float>("Hold", "TurnSway", 1f, new ConfigDescription("How much the gun lags behind quick turns (0 = none).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); SprintOffset = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Sprint", "SprintOffset", new Vector3(-0.06f, -0.0132f, -0.0792f), "While sprinting the gun moves by this (metres: right, up, forward from the carry point): down, and pushed out from the body so the left arm stays natural."); SprintAngle = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Sprint", "SprintAngle", new Vector3(-23.58f, -21.01f, -15.85f), "While sprinting the gun turns by this (degrees: pitch down, yaw in, roll), like a sprinting pose in Call of Duty."); SprintBob = ((BaseUnityPlugin)this).Config.Bind<float>("Sprint", "SprintBob", 1f, new ConfigDescription("How much the gun sways with each step: full while sprinting, about a third while walking (0 = still).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); SprintToFire = ((BaseUnityPlugin)this).Config.Bind<float>("Sprint", "SprintToFireTime", 0.25f, new ConfigDescription("Seconds after a sprint ends before the gun can fire (it swings back up).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); TracerColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Effects", "TracerColor", new Color(0.35f, 0.85f, 1f, 1f), "Colour of the bolt."); TracerWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Effects", "TracerWidth", 0.035f, "Width of the bolt at the muzzle, in metres."); KineticRoundScale = ((BaseUnityPlugin)this).Config.Bind<float>("Effects", "KineticRoundScale", 0.3f, "Size of the kinetic guns' rounds, as a share of a Litany Minigun round. Applies on the next game start."); KineticRoundStretch = ((BaseUnityPlugin)this).Config.Bind<float>("Effects", "KineticRoundStretch", 3f, "How much longer than wide the kinetic rounds are drawn (a tracer streak)."); KineticRoundSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Effects", "KineticRoundSpeed", 600f, "How fast the kinetic guns' rounds fly (m/s; only the look, hits are instant)."); JetpackVolumeBoost = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "JetpackBoost", 1.4f, new ConfigDescription("Gunshots are this much louder while you wear a jetpack (EVA muffles them).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>())); GatlingSound = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "GatlingSound", true, "The Point Blaster fires with the energy gatling turret's shot sound (else the bundled blaster .wav)."); ShotPitch = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "ShotPitch", 2f, new ConfigDescription("Pitch of the gatling shot sound (2 = twice as high).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 4f), Array.Empty<object>())); ShotVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "ShotVolume", 0.75f, new ConfigDescription("Volume of the gatling shot sound (0.75 = 25% quieter than the turret).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); ImpactVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "ImpactVolume", 0.2f, new ConfigDescription("Volume of bullet hit sounds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); ImpactRange = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "ImpactRange", 35f, "Bullet hits fade out with distance and are silent from this far away (m)."); Volume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Volume", 0.8f, new ConfigDescription("Blaster sound volume.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); DebugShots = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "LogShots", false, "Log what every shot hits (collider, layer, damage). Toggle with \"/guns debug\"."); EnemyHealth = ((BaseUnityPlugin)this).Config.Bind<float>("Test Target", "Health", 100f, "Hit points of a test target (\"/guns enemy target\"), set when it spawns."); EncountersEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Encounters", "Enabled", true, "Stations and derelicts are defended: boarding one starts an encounter."); EncounterChance = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "Chance", 1f, new ConfigDescription("Chance that a station is defended at all.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); EncounterDefenders = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "Defenders", 3f, "Enemies already there when you board (solo)."); EncounterTotal = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "Total", 6f, "Enemies in the whole encounter, defenders plus reinforcement waves (solo)."); EncounterPerExtraPlayer = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "PerExtraPlayer", 0.5f, "Extra share of enemies for each player after the first (0.5 = +50%)."); EncounterWaveInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "WaveInterval", 25f, "Seconds before the next wave comes anyway (it comes sooner once at most one enemy is left)."); EncounterAbandonRange = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "AbandonRange", 300f, "An encounter with nobody within this range (m) ..."); EncounterAbandonTime = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "AbandonTime", 60f, "... for this long (s) is called off; the station can be defended again."); AlarmVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Encounters", "AlarmVolume", 0.8f, new ConfigDescription("Volume of the encounter alarm.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); AlarmEvent = ((BaseUnityPlugin)this).Config.Bind<string>("Encounters", "AlarmEvent", "", "FMOD event path for the encounter alarm (the log lists candidates). Empty: picked automatically."); AlloyMin = ((BaseUnityPlugin)this).Config.Bind<int>("Drops", "AlloyMin", 1, "Fewest alloys a small enemy drops."); AlloyMax = ((BaseUnityPlugin)this).Config.Bind<int>("Drops", "AlloyMax", 2, "Most alloys a small enemy drops."); WeaponDropChance = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "WeaponChance", 0.1f, new ConfigDescription("Chance a small enemy drops a Point Blaster.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); BigWeaponDropChance = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "BigWeaponChance", 0.35f, new ConfigDescription("Chance a Trooper or Titan drops a gun.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); RifleDropShare = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "RifleShare", 0.25f, new ConfigDescription("Of the weapon drops, the share that are rifles (the rest are snipers or pistols).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); SniperDropShare = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "SniperShare", 0.1f, new ConfigDescription("Of the weapon drops, the share that are snipers.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); AlloyScale = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "AlloyScale", 0.5f, "Size of an alloy pickup, as a share of the game's alloy item."); AlloyGlow = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "AlloyGlow", 2.5f, "How brightly alloy pickups glow."); PickupLifetime = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "PickupLifetime", 90f, "Seconds an alloy shard stays before vanishing."); MagnetRange = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "MagnetRange", 5f, "Alloy shards drift to a player within this range (m)."); CollectRange = ((BaseUnityPlugin)this).Config.Bind<float>("Drops", "CollectRange", 1.4f, "Alloy shards are collected within this range (m)."); DroneHealth = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "Health", 100f, "Hit points of a HOLLOW Sentry (5 Point Blaster hits)."); DroneScale = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "Scale", 1f, "Size (1 = the model's 1 m). Applies to newly spawned ones."); DroneSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "Speed", 4f, "Flying speed when chasing, m/s (wandering is 40% of it)."); DroneAggroRange = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "AggroRange", 30f, "How far away (m) it notices a player it can see."); DroneAttackRange = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "AttackRange", 18f, "It fires at players within this range (m)."); DronePreferredRange = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "PreferredRange", 9f, "The distance (m) it keeps from its target."); DroneWanderRadius = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "WanderRadius", 4f, "How far (m) it drifts from where it spawned while idle."); DroneChargeTime = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "ChargeTime", 0.6f, "Seconds it charges (stopped, glowing) before each shot: the warning to dodge."); DroneFireCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "FireCooldown", 2.2f, "Seconds between shots (±15%)."); DroneBoltSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "BoltSpeed", 22f, "Bolt speed, m/s (slow enough to dodge at range)."); DroneHumVolume = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "HumVolume", 0.9f, new ConfigDescription("Volume of a drone's hover hum.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); DroneHumPitch = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "HumPitch", 2.5f, new ConfigDescription("Pitch of the hum (a ship engine sound; it rises up to 30% more with the drone's speed).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 4f), Array.Empty<object>())); DroneHumRange = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "HumRange", 25f, "How far (m) a drone's hum carries."); DroneHumSuitBoost = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "SuitBoost", 2.5f, new ConfigDescription("The hum is this much louder (and carries 50% further) while you're in a suit (EVA muffles ship-type sounds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 6f), Array.Empty<object>())); DroneHumEvent = ((BaseUnityPlugin)this).Config.Bind<string>("HOLLOW Sentry", "HumEvent", "", "FMOD event path for the hum (the log lists drone sound candidates). Empty: picked automatically. Applies on the next game start."); DroneDamage = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "Damage", 0.08f, new ConfigDescription("Damage per bolt, as a share of the player's maximum health.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); DroneShotVolume = ((BaseUnityPlugin)this).Config.Bind<float>("HOLLOW Sentry", "ShotVolume", 0.8f, new ConfigDescription("Volume of its shots.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); EnemySpawnDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Test Target", "SpawnDistance", 4f, "How far in front of you a test enemy appears, in metres."); ReloadKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "ReloadKey", (Key)32, "Key that reloads a kinetic gun (an empty one also reloads when you pull the trigger)."); HolsterKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "HolsterKey", (Key)22, "Key that holsters the held gun (hands free) or draws the holstered one."); GunDefs.Create(((BaseUnityPlugin)this).Config); HollowColors = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "HollowColors", true, "Enemies in the HOLLOW colours: black bodies, glowing purple (else the kit's own colours). Applies on the next game start."); EnemyGlowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Enemies", "GlowColor", new Color(0.62f, 0.16f, 1f, 1f), "The enemies' glow (eyes, lights, bolts, death bursts). Applies on the next game start."); ShipWeaponDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Enemies", "ShipWeaponDamage", 1f, "Ship weapons hit HOLLOW Sentries and Leapers: their damage times this (0 = they pass through harmlessly)."); EnemyHullTint = ((BaseUnityPlugin)this).Config.Bind<Color>("Enemies", "HullTint", new Color(0.1f, 0.09f, 0.12f, 1f), "Multiplies the enemies' body colours (dark: black). Applies on the next game start."); QuadShellSettings.Bind(((BaseUnityPlugin)this).Config); TitanSettings.Bind(((BaseUnityPlugin)this).Config); TrooperSettings.Bind(((BaseUnityPlugin)this).Config); TurretSettings.Bind(((BaseUnityPlugin)this).Config); WardenSettings.Bind(((BaseUnityPlugin)this).Config); KillRewards.Bind(((BaseUnityPlugin)this).Config); PersonalShield.Bind(((BaseUnityPlugin)this).Config); PlayerGrunts.Bind(((BaseUnityPlugin)this).Config); EvaAmbush.Bind(((BaseUnityPlugin)this).Config); GunCharger.Bind(((BaseUnityPlugin)this).Config); PvpClasses.Bind(((BaseUnityPlugin)this).Config); PvpScore.Bind(((BaseUnityPlugin)this).Config); PvpHud.Bind(((BaseUnityPlugin)this).Config); PvpTeams.Bind(((BaseUnityPlugin)this).Config); PvpPhase.Bind(((BaseUnityPlugin)this).Config); PvpBomb.Bind(((BaseUnityPlugin)this).Config); PvpCountdown.Bind(((BaseUnityPlugin)this).Config); PvpMovement.Bind(((BaseUnityPlugin)this).Config); PvpWalls.Bind(((BaseUnityPlugin)this).Config); ControlsHud.Bind(((BaseUnityPlugin)this).Config); UnlockAll = ((BaseUnityPlugin)this).Config.Bind<bool>("Unlocks", "UnlockAll", false, "Every Void Guns item (the Gun Charging Station) can be made at the Fabricator from the start of a run. The host's setting applies to everyone in the session. Off, it works like vanilla's locked items: recycle one found as loot to learn it, or wait for its Fabricator tier. Also \"/guns unlock\" in chat."); StationFromTier = ((BaseUnityPlugin)this).Config.Bind<int>("Unlocks", "StationFromTier", 1, new ConfigDescription("Fabricator tier that offers the Gun Charging Station (0: from the start, 1: after the first upgrade, 2: after the second, -1: only by learning it from loot). Applies on the next game start.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-1, 2), Array.Empty<object>())); StationDropChance = ((BaseUnityPlugin)this).Config.Bind<float>("Unlocks", "StationDropChance", 1.5f, "How often the Gun Charging Station drops as loot compared with the battery charge station (1.5 = 50% more often)."); ((BaseUnityPlugin)this).Config.SettingChanged += delegate(object sender, SettingChangedEventArgs args) { foreach (GunDef item in GunDefs.All) { if (item.GripSettings.Contains(args.ChangedSetting)) { GunArms.Relearn(item.Id); } } }; Harmony val = new Harmony("VoidGuns"); int num = 0; int num2 = 0; Type[] typesFromAssembly = AccessTools.GetTypesFromAssembly(typeof(Plugin).Assembly); foreach (Type type in typesFromAssembly) { if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: false).Length != 0) { try { val.CreateClassProcessor(type).Patch(); num++; } catch (Exception ex) { num2++; Log.LogError((object)("Void Guns: patch " + type.FullName + " failed and was skipped: " + ex.GetBaseException().Message)); } } } Log.LogInfo((object)string.Format("{0} {1} loaded ({2} patches{3})", "Void Guns", "0.5.2", num, (num2 > 0) ? $", {num2} FAILED" : "")); } } public static class VoidGunsApi { public const int Version = 8; public static bool IsHost { get { if (!PhotonNetwork.IsMasterClient) { return !PhotonNetwork.InRoom; } return true; } } public static void AddContainment(Func<Vector3, bool?> check) { Containment.Add(check); } public static void RemoveContainment(Func<Vector3, bool?> check) { Containment.Remove(check); } public static void AddRouter(Func<Vector3, Vector3, Vector3?> router) { Containment.AddRouter(router); } public static void RemoveRouter(Func<Vector3, Vector3, Vector3?> router) { Containment.RemoveRouter(router); } public static void SpawnAlloys(Vector3 position, int amount) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (IsHost) { Drops.HostSpawnAlloys(position, amount); } } public static bool SpawnGun(string kind, Vector3 position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (IsHost) { return Drops.HostSpawnGun(kind, position); } return false; } public static void SpawnShieldCell(Vector3 position, int tier) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (IsHost) { Drops.HostSpawnShieldCell(position, tier); } } public static void RefillPlayer() { KillRewards.RefillAll(); } public static int Find(string kind) { EnemyKind? enemyKind = KindOf(kind); foreach (Enemy value in Enemy.All.Values) { if (enemyKind.HasValue && (Object)(object)value != (Object)null && value.Kind == enemyKind.Value && value.Health > 0f) { return value.Id; } } return -1; } public static bool Position(int id, out Vector3 position) { //IL_0001: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) position = Vector3.zero; if (!Enemy.All.TryGetValue(id, out var value) || (Object)(object)value == (Object)null) { return false; } position = value.WorldPosition; return true; } public static bool Health(int id, out float health, out float max) { health = (max = 0f); if (!Enemy.All.TryGetValue(id, out var value) || (Object)(object)value == (Object)null) { return false; } health = value.Health; max = value.MaxHealth; return true; } public static void SetHealth(int id, float health, float max) { if (IsHost && Enemy.All.TryGetValue(id, out var value) && (Object)(object)value != (Object)null && max > 0f) { value.SetHealth(Mathf.Clamp(health, 1f, max), max); EnemyMessage.State(value, reliable: true); } } public static bool SetWardenModel(string dir) { WardenModel.Dir = dir; if (!string.IsNullOrEmpty(dir)) { return File.Exists(Path.Combine(dir, "warden.json")); } return false; } private static EnemyKind? KindOf(string kind) { return (kind ?? "").ToLowerInvariant() switch { "sentry" => EnemyKind.EyeDrone, "leaper" => EnemyKind.QuadShell, "trooper" => EnemyKind.Trooper, "titan" => EnemyKind.Titan, "turret" => EnemyKind.Turret, "warden" => EnemyKind.Warden, _ => null, }; } public static int Spawn(string kind, Vector3 position, Quaternion rotation) { //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) EnemyKind? enemyKind = KindOf(kind); if (!IsHost || !enemyKind.HasValue) { return -1; } return Enemies.HostSpawn(enemyKind.Value, -1, position, rotation).Id; } public static bool IsAlive(int id) { if (Enemy.All.TryGetValue(id, out var value) && (Object)(object)value != (Object)null) { return value.Health > 0f; } return false; } public static void Remove(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (IsHost && Enemy.All.TryGetValue(id, out var value) && (Object)(object)value != (Object)null) { EnemyMessage.Send(EnemyMessage.Op.Remove, id); Object.Destroy((Object)(object)((Component)value).gameObject); } } public static void Positions(List<Vector3> into) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) into.Clear(); foreach (Enemy value in Enemy.All.Values) { if ((Object)(object)value != (Object)null && value.Health > 0f) { into.Add(value.WorldPosition); } } } } public class VoidManagerPlugin : VoidPlugin { public override MultiplayerType MPType => (MultiplayerType)30; public override string Author => "NeoLorem"; public override string Description => "Craftable hand-held blasters for on-foot combat."; } } namespace VoidGuns.Patches { [HarmonyPatch(typeof(CarryableInteract), "StartInteraction")] internal static class BlasterInteractPatch { private static bool Prefix(AbstractInteractable interactable) { if (HoldingBlaster()) { return !(interactable is Grabbable); } return true; } internal static bool HoldingBlaster() { LocalPlayer instance = LocalPlayer.Instance; if ((Object)(object)instance != (Object)null && (Object)(object)((Player)instance).Payload != (Object)null) { return (Object)(object)((Component)((Player)instance).Payload).GetComponent<Blaster>() != (Object)null; } return false; } } [HarmonyPatch(typeof(CarryableInteract), "StartThrow")] internal static class BlasterNoThrowStartPatch { private static bool Prefix() { return !BlasterInteractPatch.HoldingBlaster(); } } [HarmonyPatch(typeof(CarryableInteract), "EndThrow")] internal static class BlasterNoThrowEndPatch { private static bool Prefix() { return !BlasterInteractPatch.HoldingBlaster(); } } [HarmonyPatch(typeof(CameraController), "LateUpdate")] internal static class CameraLateUpdatePatch { private static void Postfix() { GunArms.AfterCamera(); } } [HarmonyPatch(typeof(CharacterIK), "LateUpdate")] internal static class CharacterIKLateUpdatePatch { private static void Postfix(CharacterIK __instance) { GunArms.AfterCharacterIK((Component)(object)__instance); } } [HarmonyPatch(typeof(RuntimeAssetLoadingService), "Initialize")] internal static class RuntimeAssetLoadingPatch { private static void Postfix(ref IEnumerator __result) { __result = RunThenRegister(__result); } private static IEnumerator RunThenRegister(IEnumerator original) { while (original.MoveNext()) { yield return original.Current; } try { GunAssets.Register(); } catch (Exception arg) { Plugin.Log.LogError((object)$"Failed to register the {GunAssets.PointBlasterName}: {arg}"); } try { GunCharger.Register(); GunsLoot.MirrorEndlessRewards(); } catch (Exception arg2) { Plugin.Log.LogError((object)string.Format("Failed to register the {0}: {1}", "Gun Charging Station", arg2)); } } } [HarmonyPatch(typeof(CarryablesSocket), "DoesAccept")] internal static class ShelfAcceptsGunsPatch { private static void Postfix(CarryablesSocket __instance, CarryableObject carryable, ref bool __result) { if ((Object)(object)((Component)__instance).GetComponentInParent<GunChargerModule>() != (Object)null) { __result = (Object)(object)carryable != (Object)null && (Object)(object)((Component)carryable).GetComponent<Blaster>() != (Object)null; } else if (!__result && (Object)(object)carryable != (Object)null && (Object)(object)((Component)carryable).GetComponent<Blaster>() != (Object)null && (Object)(object)((Component)__instance).GetComponentInParent<CarryablesShelf>() != (Object)null) { __result = true; } } } } namespace VoidGuns.Content { internal static class AfterLateUpdate { [StructLayout(LayoutKind.Sequential, Size = 1)] private struct Marker { } [CompilerGenerated] private static class <>O { public static UpdateFunction <0>__Run; } public static int LastRunFrame = -10; public static bool Running => LastRunFrame >= Time.frameCount - 2; public static void Ensure() { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_003b: 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_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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown PlayerLoopSystem currentPlayerLoop = PlayerLoop.GetCurrentPlayerLoop(); if (currentPlayerLoop.subSystemList == null) { return; } for (int i = 0; i < currentPlayerLoop.subSystemList.Length; i++) { if (currentPlayerLoop.subSystemList[i].type != typeof(PreLateUpdate)) { continue; } List<PlayerLoopSystem> list = new List<PlayerLoopSystem>((IEnumerable<PlayerLoopSystem>)(((object)currentPlayerLoop.subSystemList[i].subSystemList) ?? ((object)new PlayerLoopSystem[0]))); if (!list.Exists((PlayerLoopSystem s) => s.type == typeof(Marker))) { int num = list.FindIndex((PlayerLoopSystem s) => s.type == typeof(ScriptRunBehaviourLateUpdate)); int index = ((num >= 0) ? (num + 1) : list.Count); PlayerLoopSystem item = new PlayerLoopSystem { type = typeof(Marker) }; object obj = <>O.<0>__Run; if (obj == null) { UpdateFunction val = Run; <>O.<0>__Run = val; obj = (object)val; } item.updateDelegate = (UpdateFunction)obj; list.Insert(index, item); currentPlayerLoop.subSystemList[i].subSystemList = list.ToArray(); PlayerLoop.SetPlayerLoop(currentPlayerLoop); Plugin.Log.LogInfo((object)("Added the gun pass to the frame loop (" + ((num >= 0) ? "after LateUpdate" : "at the end of PreLateUpdate") + ")")); } break; } } private static void Run() { LastRunFrame = Time.frameCount; try { GunArms.FinalPass(); } catch (Exception arg) { Plugin.Log.LogError((object)$"Gun pass failed: {arg}"); } try { PvpEnd.ApplyCamera(); } catch (Exception arg2) { Plugin.Log.LogError((object)$"PvP end camera failed: {arg2}"); } try { PvpBomb.ApplySpectate(); } catch (Exception arg3) { Plugin.Log.LogError((object)$"PvP spectate camera failed: {arg3}"); } try { ScopeView.Apply(); } catch (Exception arg4) { Plugin.Log.LogError((object)$"Scope view failed: {arg4}"); } } } internal enum AlertLevel { Danger, Warning, Good } internal static class AlertBanner { private const float FadeIn = 0.2f; private const float Hold = 3.4f; private const float FadeOut = 0.7f; private static string text; private static AlertLevel level; private static float shownAt = -100f; private static GUIStyle style; public static void Show(string message, AlertLevel alertLevel) { text = message; level = alertLevel; shownAt = Time.unscaledTime; if (alertLevel == AlertLevel.Good) { ShotEffects.PlayLocal("rifle-power-cell-insert", 0.7f); } else { Alarm.Play(); } } public static void Draw() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0086: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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) //IL_0189: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) float num = Time.unscaledTime - shownAt; if (!string.IsNullOrEmpty(text) && !(num > 4.3f) && (int)Event.current.type == 7) { float num2 = ((num < 0.2f) ? (num / 0.2f) : ((num < 3.6000001f) ? 1f : (1f - (num - 0.2f - 3.4f) / 0.7f))); float num3 = (float)Screen.height / 1080f; if (style == null) { style = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontStyle = (FontStyle)1, wordWrap = false }; } style.fontSize = Mathf.RoundToInt(34f * num3); Color val = ((level == AlertLevel.Danger) ? new Color(1f, 0.28f, 0.22f) : ((level == AlertLevel.Warning) ? new Color(1f, 0.62f, 0.15f) : new Color(0.35f, 1f, 0.55f))); float num4 = ((level != AlertLevel.Good && num < 1.5f) ? (0.75f + 0.25f * Mathf.Abs(Mathf.Sin(num * 9f))) : 1f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, (float)Screen.height * 0.2f - 32f * num3, (float)Screen.width, 64f * num3); Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.45f * num2); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(val.r, val.g, val.b, 0.9f * num2); GUI.DrawTexture(new Rect(0f, ((Rect)(ref val2)).y, (float)Screen.width, 2f * num3), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(0f, ((Rect)(ref val2)).yMax - 2f * num3, (float)Screen.width, 2f * num3), (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(0f, 0f, 0f, 0.8f * num2); GUI.Label(new Rect(((Rect)(ref val2)).x + 2f * num3, ((Rect)(ref val2)).y + 2f * num3, ((Rect)(ref val2)).width, ((Rect)(ref val2)).height), text.ToUpperInvariant(), style); GUI.color = new Color(val.r * num4, val.g * num4, val.b * num4, num2); GUI.Label(val2, text.ToUpperInvariant(), style); GUI.color = color; } } } internal static class Alarm { private static bool searched; private static EventReference alarm; private static bool oneShot; public static void Play() { //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) //IL_0028: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (!Find()) { ShotEffects.PlayLocal("low-power-warning-click", 0.9f); return; } EventInstance instance = RuntimeManager.CreateInstance(alarm); if (!((EventInstance)(ref instance)).isValid()) { return; } ((EventInstance)(ref instance)).setVolume(Plugin.AlarmVolume.Value * Plugin.Volume.Value); ((EventInstance)(ref instance)).start(); if (oneShot) { ((EventInstance)(ref instance)).release(); return; } new GameObject("VoidGuns_AlarmStop").AddComponent<FadeOut>().Init(2f, delegate(float t) { //IL_000f: 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) if (t >= 1f) { ((EventInstance)(ref instance)).stop((STOP_MODE)0); ((EventInstance)(ref instance)).release(); } }); } private static bool Find() { //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_0047: 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_0066: 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_0086: 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_0091: 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_00f1: Invalid comparison between Unknown and I4 //IL_0186: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) if (searched) { return !((EventReference)(ref alarm)).IsNull; } searched = true; string text = Plugin.AlarmEvent.Value?.Trim(); List<string> list = new List<string>(); string text2 = null; int num = -1; System studioSystem = RuntimeManager.StudioSystem; Bank[] array = default(Bank[]); if ((int)((System)(ref studioSystem)).getBankList(ref array) == 0) { Bank[] array2 = array; EventDescription[] array3 = default(EventDescription[]); string text3 = default(string); bool flag2 = default(bool); GUID guid = default(GUID); for (int i = 0; i < array2.Length; i++) { Bank val = array2[i]; if ((int)((Bank)(ref val)).getEventList(ref array3) != 0) { continue; } EventDescription[] array4 = array3; for (int j = 0; j < array4.Length; j++) { EventDescription val2 = array4[j]; if ((int)((EventDescription)(ref val2)).getPath(ref text3) != 0 || string.IsNullOrEmpty(text3) || !text3.StartsWith("event:/")) { continue; } string text4 = text3.ToLowerInvariant(); if (!((!string.IsNullOrEmpty(text)) ? (text3 != text) : (!text4.Contains("alarm")))) { bool flag = (int)((EventDescription)(ref val2)).isOneshot(ref flag2) == 0 && flag2; list.Add(text3 + (flag ? " (one-shot)" : "")); int num2 = (flag ? 2 : 0) + ((text4.Contains("intruder") || text4.Contains("boarding") || text4.Contains("enemy") || text4.Contains("hostile")) ? 4 : 0) + ((text4.Contains("warning") || text4.Contains("alert")) ? 1 : 0); if (num2 > num && (int)((EventDescription)(ref val2)).getID(ref guid) == 0) { num = num2; text2 = text3; alarm = new EventReference { Guid = guid }; oneShot = flag; } } } } } Plugin.Log.LogInfo((object)string.Format("Encounter alarm candidates ({0}): {1}", list.Count, string.Join(", ", list))); Plugin.Log.LogInfo((object)((text2 != null) ? ("Encounter alarm: " + text2) : "Encounter alarm: none found; using the bundled warning click")); return !((EventReference)(ref alarm)).IsNull; } } internal static class AmmoHud { private static GUIStyle big; private static GUIStyle small; private static GUIStyle name; private static GUIStyle warn; private static GUIStyle grenadeStyle; public static void Draw() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Invalid comparison between Unknown and I4 //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Invalid comparison between Unknown and I4 //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_028a: 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_0311: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_047d: 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_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032f: 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_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) if ((int)Event.current.type == 7 && big == null) { big = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)8, fontStyle = (FontStyle)1 }; small = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)6, fontStyle = (FontStyle)1 }; name = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)8, fontStyle = (FontStyle)1 }; warn = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)8, fontStyle = (FontStyle)1 }; } Blaster heldLocal = Blaster.HeldLocal; if (!((Object)(object)heldLocal == (Object)null) && (int)Event.current.type == 7 && (int)Cursor.lockState == 1 && !(ScopeView.Amount > 0.5f)) { float num = (float)Screen.height / 1080f; big.fontSize = Mathf.RoundToInt(46f * num); small.fontSize = Mathf.RoundToInt(20f * num); name.fontSize = Mathf.RoundToInt(17f * num); warn.fontSize = Mathf.RoundToInt(15f * num); float num2 = (float)Screen.width - 48f * num; float num3 = (float)Screen.height - 46f * num; bool value = GunCharger.Enabled.Value; float capacity = heldLocal.Capacity; float num4 = Mathf.Max(0f, heldLocal.Charge); bool active = PvpMaps.Active; float num5 = ((value && !active) ? Mathf.Clamp01(num4 / capacity) : 1f); bool kinetic = heldLocal.Def.Kinetic; bool flag = ((!kinetic) ? ((value || heldLocal.Def.Thrown) && !active && num4 < 1f) : (heldLocal.Magazine <= 0 && heldLocal.Reserve <= 0)); bool flag2 = value && num5 < 0.25f; Color val = (flag ? new Color(1f, 0.3f, 0.25f) : (flag2 ? new Color(1f, 0.7f, 0.25f) : new Color(0.92f, 0.95f, 1f))); Color color = GUI.color; float num6 = 190f * num; float num7 = 4f * num; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num2 - num6, num3, num6, num7); if (value) { GUI.color = new Color(0f, 0f, 0f, 0.55f); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x - 1f, ((Rect)(ref val2)).y - 1f, ((Rect)(ref val2)).width + 2f, ((Rect)(ref val2)).height + 2f), (Texture)(object)Texture2D.whiteTexture); Color val3 = (flag ? val : Color.Lerp(new Color(1f, 0.55f, 0.15f), Plugin.TracerColor.Value, Mathf.InverseLerp(0.1f, 0.5f, num5))); GUI.color = new Color(val3.r, val3.g, va