Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of LethalBotsWheel v1.29.20
LethalBotsWheel.dll
Decompiled 2 weeks 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.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalBots.AI; using LethalBots.AI.AIStates; using LethalBots.Managers; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace Erskine.LethalBotsWheel; [BepInPlugin("Erskine.LethalBotsWheel", "LethalBotsWheel", "1.29.20")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal enum OpenMode { Keyboard, MouseForward, MouseBack, MouseMiddle, MouseLeft, MouseRight } public const string GUID = "Erskine.LethalBotsWheel"; public const string NAME = "LethalBotsWheel"; public const string VERSION = "1.29.20"; internal static Plugin Instance; internal static ManualLogSource Log; internal ConfigEntry<string> cOpenKey; internal ConfigEntry<string> cActivation; internal ConfigEntry<float> cRadius; internal ConfigEntry<bool> cCursorFreeRoam; internal ConfigEntry<float> cDeadzone; internal ConfigEntry<float> cCursorSize; internal ConfigEntry<bool> cFreezeView; internal ConfigEntry<string> cNextPage; internal ConfigEntry<string> cPrevPage; internal ConfigEntry<string> cNextTarget; internal ConfigEntry<string> cPrevTarget; internal ConfigEntry<bool> cInvertScroll; internal ConfigEntry<bool> cScrollTarget; internal ConfigEntry<bool> cWalkieRange; internal ConfigEntry<bool> cLongRangeWalkie; internal ConfigEntry<bool> cControlWhileDead; internal ConfigEntry<bool> cFollowKeepsUp; internal ConfigEntry<bool> cAutoScavengeDead; internal ConfigEntry<float> cFollowRange; internal ConfigEntry<float> cNumX; internal ConfigEntry<float> cNumY; internal ConfigEntry<float> cCenterScale; internal readonly Bind bindNextPage; internal readonly Bind bindPrevPage; internal readonly Bind bindNextTarget; internal readonly Bind bindPrevTarget; internal OpenMode Mode; internal Key KbKey; [CompilerGenerated] private static Dictionary<string, int> _003C_003Ef__switch_0024map0; internal bool IsToggle { [CompilerGenerated] get { return cActivation != null && string.Equals((cActivation.Value ?? "").Trim(), "toggle", StringComparison.OrdinalIgnoreCase); } } public Plugin() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) bindNextPage = new Bind(); bindPrevPage = new Bind(); bindNextTarget = new Bind(); bindPrevTarget = new Bind(); Mode = OpenMode.MouseForward; KbKey = (Key)36; } private void ParseOpen(string s) { //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) s = (s ?? "").Trim().ToLower(); if (s != null) { if (_003C_003Ef__switch_0024map0 == null) { Dictionary<string, int> dictionary = new Dictionary<string, int>(21); dictionary.Add("mouse5", 0); dictionary.Add("mb5", 0); dictionary.Add("forward", 0); dictionary.Add("forwardbutton", 0); dictionary.Add("mouse4", 1); dictionary.Add("mb4", 1); dictionary.Add("back", 1); dictionary.Add("backbutton", 1); dictionary.Add("mouse3", 2); dictionary.Add("mb3", 2); dictionary.Add("middle", 2); dictionary.Add("middlebutton", 2); dictionary.Add("mousemiddle", 2); dictionary.Add("mouse1", 3); dictionary.Add("mb1", 3); dictionary.Add("left", 3); dictionary.Add("mouseleft", 3); dictionary.Add("mouse2", 4); dictionary.Add("mb2", 4); dictionary.Add("right", 4); dictionary.Add("mouseright", 4); _003C_003Ef__switch_0024map0 = dictionary; } if (_003C_003Ef__switch_0024map0.TryGetValue(s, out var value)) { switch (value) { case 0: Mode = OpenMode.MouseForward; return; case 1: Mode = OpenMode.MouseBack; return; case 2: Mode = OpenMode.MouseMiddle; return; case 3: Mode = OpenMode.MouseLeft; return; case 4: Mode = OpenMode.MouseRight; return; } } } if (Enum.TryParse<Key>(s, ignoreCase: true, out Key result)) { Mode = OpenMode.Keyboard; KbKey = result; } else { Log.LogWarning((object)$"Couldn't parse OpenKey '{s}', defaulting to V."); Mode = OpenMode.Keyboard; KbKey = (Key)36; } } internal bool IsOpenHeld() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) switch (Mode) { case OpenMode.MouseForward: { Mouse current6 = Mouse.current; return current6 != null && current6.forwardButton.isPressed; } case OpenMode.MouseBack: { Mouse current2 = Mouse.current; return current2 != null && current2.backButton.isPressed; } case OpenMode.MouseMiddle: { Mouse current4 = Mouse.current; return current4 != null && current4.middleButton.isPressed; } case OpenMode.MouseLeft: { Mouse current3 = Mouse.current; return current3 != null && current3.leftButton.isPressed; } case OpenMode.MouseRight: { Mouse current5 = Mouse.current; return current5 != null && current5.rightButton.isPressed; } default: { Keyboard current = Keyboard.current; return current != null && ((ButtonControl)current[KbKey]).isPressed; } } } internal bool IsOpenPressed() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) switch (Mode) { case OpenMode.MouseForward: { Mouse current6 = Mouse.current; return current6 != null && current6.forwardButton.wasPressedThisFrame; } case OpenMode.MouseBack: { Mouse current2 = Mouse.current; return current2 != null && current2.backButton.wasPressedThisFrame; } case OpenMode.MouseMiddle: { Mouse current4 = Mouse.current; return current4 != null && current4.middleButton.wasPressedThisFrame; } case OpenMode.MouseLeft: { Mouse current3 = Mouse.current; return current3 != null && current3.leftButton.wasPressedThisFrame; } case OpenMode.MouseRight: { Mouse current5 = Mouse.current; return current5 != null && current5.rightButton.wasPressedThisFrame; } default: { Keyboard current = Keyboard.current; return current != null && ((ButtonControl)current[KbKey]).wasPressedThisFrame; } } } private void Awake() { //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Expected O, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; cOpenKey = ((BaseUnityPlugin)this).Config.Bind<string>("General", "OpenKey", "V", "Hold this to open the command wheel; release on a slice to run it. Default is the keyboard key V. If your mouse has extra buttons you can use: Mouse5 (forward thumb button), Mouse4 (back thumb button), Mouse3 (middle/scroll click), Mouse1/Mouse2 (left/right). Any keyboard key name also works (C, LeftAlt, F, ...)."); cActivation = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Activation", "Hold", "How the open button works. 'Hold' = the wheel is open only while you hold the button and fires the slice you're pointing at when you release. 'Toggle' = press once to open (it stays open), then press again to fire the selected slice."); cRadius = ((BaseUnityPlugin)this).Config.Bind<float>("General", "WheelSize", 240f, "Size of the wheel, in pixels (this is the radius, so the wheel is roughly twice this across). Bigger = larger wheel."); cCursorFreeRoam = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "CursorFreeRoam", true, "Fortnite-style: let the aiming cursor fly out past the wheel toward the screen edge, so you can flick in a direction to pick a slice instead of stopping at the ring. Turn off to clamp the cursor to the wheel edge (old behavior)."); cDeadzone = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Deadzone", 45f, "How far (in pixels) you must move the mouse from center before a slice is selected. Release inside this dead zone to cancel without running anything. Note: the wheel always keeps the dead zone at least as large as the center hub, so a slice never triggers while you're hovering the middle — raise this only if you want even more leeway."); cCursorSize = ((BaseUnityPlugin)this).Config.Bind<float>("General", "CursorSize", 16f, "Size (in pixels) of the aiming cursor dot in the middle of the wheel. Bigger = easier to see."); cFreezeView = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "FreezeViewWhileOpen", true, "Freeze your camera while the wheel is open, so aiming at a slice doesn't also spin your view. Recommended on."); cControlWhileDead = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ControlBotsWhileDead", false, "Let you open the wheel and command your bots even after you've died (while spectating). Commands that need a living body (Follow, Regroup, Go To Bot, Teleport Me) are greyed out and can't be selected while you're dead; everything else (Lead Way, To Ship, Transfer, Collect Delivery, etc.) still works. Default off."); cFollowKeepsUp = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "FollowKeepsUpWhenFar", true, "Fixes bots giving up on Follow when you're far away. Base LethalBots stops pathing to you once you're past ~25m and instead needs line of sight — so if you round a corner or go into another room, the bot 'loses' you and wanders off. With this on, a bot that's in your follow group keeps pathing to your actual position even without line of sight, so it catches up instead of giving up. Only affects bots actively following you. Default on."); cAutoScavengeDead = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AutoScavengeWhenDead", false, "When YOU die, keep your bots working instead of standing around — and resume the RIGHT task. Base LethalBots pulls your bots off whatever they're doing into 'where did my leader go' idle states when you go down, so even a bot mid-haul or mid-scavenge stops. With this on, while you're dead the mod puts each idle bot back on what it was doing: a bot that was hauling loot to the ship resumes hauling, a scavenger resumes scavenging (default if it had no clear task). Bots that are fighting, reviving, or manning the ship are left alone. Stops the moment you're revived. Default off."); cFollowRange = ((BaseUnityPlugin)this).Config.Bind<float>("General", "MaxFollowLeadRange", 50f, "Follow and Lead Way grey out on the wheel when the bot you're targeting is farther than this many metres from you, so you can't yank a bot that's across the map. If you target 'All Bots' or 'Nearest', it stays available as long as at least one targeted bot is within range. Set to 0 to turn the range limit off (all commands always selectable)."); cNumX = ((BaseUnityPlugin)this).Config.Bind<float>("Advanced", "HotkeyNumberNudgeX", 0f, "Fine-tune the horizontal position of the 1-8 hotkey numbers inside their chips, in pixels (+ = right). Leave 0 unless they look off-center on your resolution."); cNumY = ((BaseUnityPlugin)this).Config.Bind<float>("Advanced", "HotkeyNumberNudgeY", 1f, "Fine-tune the vertical position of the 1-8 hotkey numbers inside their chips, in pixels (+ = down). Bold digits tend to sit a hair high, so a small positive value centers them."); cCenterScale = ((BaseUnityPlugin)this).Config.Bind<float>("General", "CenterTextScale", 1.2f, "Scales the text in the middle of the wheel — the selected command name, the target line, and the two hint lines. 1.0 = the original size; raise it for bigger, more readable center text (long target names still auto-shrink to fit, but the whole cluster scales up)."); cNextPage = ((BaseUnityPlugin)this).Config.Bind<string>("General", "NextPageBind", "mouse2", "Button/key to flip to the NEXT page while the wheel is open. Default: right-click."); cPrevPage = ((BaseUnityPlugin)this).Config.Bind<string>("General", "PrevPageBind", "none", "Optional button/key to flip to the PREVIOUS page. 'none' to disable."); cNextTarget = ((BaseUnityPlugin)this).Config.Bind<string>("General", "NextTargetBind", "none", "Optional button/key to cycle to the NEXT target (the scroll wheel always cycles too). 'none' to disable."); cPrevTarget = ((BaseUnityPlugin)this).Config.Bind<string>("General", "PrevTargetBind", "none", "Optional button/key to cycle to the PREVIOUS target. 'none' to disable."); cInvertScroll = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "InvertTargetScroll", false, "Flip which direction the scroll wheel cycles through targets."); cScrollTarget = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ScrollCyclesTarget", true, "Let the mouse scroll wheel cycle the target (All Bots / Nearest / a bot by name) while the wheel is open. Turn this off if you'd rather only use the NextTargetBind / PrevTargetBind keys, or if scroll conflicts with something else."); cWalkieRange = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "WalkieRange", true, "If on, Follow and Lead Way stay usable on a far-away bot (instead of greying out past MaxFollowLeadRange) when you are holding an active walkie-talkie AND that bot is carrying a walkie-talkie. Lets you command distant bots over the radio. Default on."); cLongRangeWalkie = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "LongRangeNeedsWalkie", false, "Radio-range mode. When on, EVERY command (not just Follow and Lead Way) greys out on a bot farther than MaxFollowLeadRange unless you and that bot both have a walkie-talkie, so you can only order distant bots over the radio. Go To Bot is exempt since its whole purpose is reaching a far bot. Off by default (only Follow and Lead Way are range-limited)."); ParseOpen(cOpenKey.Value); cOpenKey.SettingChanged += delegate { ParseOpen(cOpenKey.Value); }; bindNextPage.Parse(cNextPage.Value); cNextPage.SettingChanged += delegate { bindNextPage.Parse(cNextPage.Value); }; bindPrevPage.Parse(cPrevPage.Value); cPrevPage.SettingChanged += delegate { bindPrevPage.Parse(cPrevPage.Value); }; bindNextTarget.Parse(cNextTarget.Value); cNextTarget.SettingChanged += delegate { bindNextTarget.Parse(cNextTarget.Value); }; bindPrevTarget.Parse(cPrevTarget.Value); cPrevTarget.SettingChanged += delegate { bindPrevTarget.Parse(cPrevTarget.Value); }; GameObject val = new GameObject("LethalBotsWheel_Runner"); Object.DontDestroyOnLoad((Object)val); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<WheelRunner>(); FollowFix.Install(); Log.LogInfo((object)string.Concat("LethalBotsWheel v1.29.20 active. [", cOpenKey.Value, "] (", Mode, ", ", cActivation.Value, "); scroll = target, [", cNextPage.Value, "] = page.")); } } public class WheelRunner : MonoBehaviour { private struct Cmd { public string Name; public Action<LethalBotAI[]> Run; public string Say; public bool Single; public bool PlayerBound; public bool RangeGated; public bool NoAllBots; public Cmd(string n, Action<LethalBotAI[]> r, string say = null, bool single = false, bool playerBound = false, bool rangeGated = false, bool noAllBots = false) { Name = n; Run = r; Say = say; Single = single; PlayerBound = playerBound; RangeGated = rangeGated; NoAllBots = noAllBots; } } private enum TKind { All, Nearest, Named } private struct Target { public TKind Kind; public string Name; public string Label; } private struct ResumeInfo { public LethalBotAI bot; public AIState prev; public bool wasManning; } private readonly List<List<Cmd>> _pages = new List<List<Cmd>>(); private int _page; private readonly List<Target> _targets = new List<Target>(); private int _tIdx; private float _lastScroll; private TKind _savedKind = TKind.All; private string _savedName; private bool _open; private Vector2 _sel; private int _selIndex = -1; private readonly List<InputActionMap> _suspended = new List<InputActionMap>(); private Quaternion _bodyRot; private Quaternion _camLocalRot; private Transform _camTf; private Transform _bodyTf; private GUIStyle _pillDark; private GUIStyle _pillSel; private GUIStyle _pillDisabled; private GUIStyle _center; private GUIStyle _sub; private GUIStyle _hint; private GUIStyle _status; private GUIStyle _num; private Texture2D _solid; private Texture2D _texBase; private Texture2D _texHi; private Texture2D _texNum; private bool _texTried; private static readonly LethalBotAI[] Empty = (LethalBotAI[])(object)new LethalBotAI[0]; private int _ttfFrame = -1; private bool _ttfCache; private static readonly HashSet<string> _haulStates = new HashSet<string> { "TransferLootState", "ReturnToShipState", "SellScrapState", "CollectScrapToSellState" }; private static readonly HashSet<string> _scavengeStates = new HashSet<string> { "SearchingForScrapState", "FetchingObjectState" }; private static readonly HashSet<string> _leaveAloneStates = new HashSet<string> { "BrainDeadState", "FightEnemyState", "HealPlayerState", "RescueAndReviveState", "MissionControlState", "PanikState", "GrabLoadoutState", "ChargeHeldItemState", "CollectPurchasedItemsState", "UseInverseTeleporterState", "UseKeyOnLockedDoorState", "UseTZPInhalantState", "TransferLootState", "ReturnToShipState", "SellScrapState", "CollectScrapToSellState", "SearchingForScrapState", "FetchingObjectState" }; private const int TASK_SCAVENGE = 1; private const int TASK_HAUL = 2; private readonly Dictionary<LethalBotAI, int> _lastTask = new Dictionary<LethalBotAI, int>(); private readonly Dictionary<LethalBotAI, float> _lastResume = new Dictionary<LethalBotAI, float>(); private const float ResumeCooldown = 6f; private float _nextScavengeTick; private static readonly Dictionary<string, string[]> _persona = new Dictionary<string, string[]> { { "Follow", new string[5] { "On your six!", "Fine, moving.", "Coming along!", "Following. Acknowledged.", "Try to keep up." } }, { "Lead Way", new string[5] { "Scrap hunt, let's go!", "Off to dig.", "Loot time!", "Scavenging. Proceeding.", "I'll grab the good stuff." } }, { "Wait Here", new string[5] { "Posted up!", "Not moving.", "Happy to wait!", "Holding. Standing by.", "I'll hold it down." } }, { "Regroup", new string[5] { "On my way to you!", "Regrouping, hang on.", "Coming to you!", "Regrouping. Acknowledged.", "Miss me? Coming." } }, { "To Ship", new string[5] { "Back to the ship!", "Heading in.", "Shipward bound!", "Returning to ship.", "Ship's calling, on it." } }, { "Grab Loadout", new string[5] { "Grabbing my kit!", "Getting my gear.", "Gearing up!", "Retrieving equipment.", "Suiting up, obviously." } }, { "Man Ship", new string[5] { "I've got the terminal!", "Manning the terminal.", "On terminal duty!", "Terminal. Acknowledged.", "Terminal's mine." } }, { "Go To Bot", new string[5] { "Over here!", "This way.", "Right here!", "My position. Here.", "Found me. Nice." } }, { "Transfer", new string[5] { "Hauling loot in!", "Moving the loot.", "Loot delivery!", "Transferring scrap.", "I'll haul it, watch." } }, { "Change Suit", new string[5] { "Matching you!", "Suit swapped.", "New look!", "Suit changed.", "Looking good now." } }, { "Collect Delivery", new string[5] { "Grabbing the delivery!", "Getting the crate.", "Delivery run!", "Collecting delivery.", "That's mine now." } } }; private bool _warmed; private string _warmChars; private readonly List<ResumeInfo> _collectResume = new List<ResumeInfo>(); private Coroutine _collectLatchCo; private static FieldInfo _collectLatchField; private static bool _collectLatchResolved; private void Awake() { _pages.Add(new List<Cmd> { new Cmd("Follow", CmdFollow, "Right behind you!", single: false, playerBound: true, rangeGated: true), new Cmd("Lead Way", CmdLeadWay, "Going for scrap!", single: false, playerBound: false, rangeGated: true), new Cmd("Wait Here", CmdWait, "Holding here."), new Cmd("Regroup", CmdRegroup, "Regrouping on you!", single: false, playerBound: true), new Cmd("To Ship", CmdToShip, "Heading to the ship."), new Cmd("Grab Loadout", CmdGearUp, "Grabbing my gear."), new Cmd("Man Ship", CmdManShip, "Manning the terminal.", single: true, playerBound: false, rangeGated: false, noAllBots: true), new Cmd("Go To Bot", CmdGoToBot, "Over here!", single: true, playerBound: true, rangeGated: false, noAllBots: true) }); _pages.Add(new List<Cmd> { new Cmd("Transfer", CmdTransfer, "Hauling loot to the ship."), new Cmd("Drop Item", delegate(LethalBotAI[] t) { ChatCmd(t, "drop your held item"); }), new Cmd("Change Suit", CmdChangeSuit, "Matching your suit."), new Cmd("Monitor Me", delegate(LethalBotAI[] t) { ChatCmd(t, "request monitoring"); }), new Cmd("Teleport Me", delegate(LethalBotAI[] t) { ChatCmd(t, "request teleport"); }, null, single: false, playerBound: true), new Cmd("Stop Monitor", delegate(LethalBotAI[] t) { ChatCmd(t, "clear monitoring"); }), new Cmd("Take Off", delegate(LethalBotAI[] t) { ChatCmd(t, "start the ship"); }, null, single: true, playerBound: false, rangeGated: false, noAllBots: true), new Cmd("Report", CmdReport, null, single: true, playerBound: false, rangeGated: false, noAllBots: true) }); _pages.Add(new List<Cmd> { new Cmd("Collect Delivery", CmdCollectDelivery) }); } private List<Cmd> Cur() { return _pages[Mathf.Clamp(_page, 0, _pages.Count - 1)]; } private PlayerControllerB LocalPlayer() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GameNetworkManager instance = GameNetworkManager.Instance; return ((Object)instance != (Object)null) ? instance.localPlayerController : null; } private bool CanOpen(PlayerControllerB lp) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if ((Object)lp == (Object)null || lp.inTerminalMenu || lp.isTypingChat) { return false; } if (lp.isPlayerDead) { return Plugin.Instance.cControlWhileDead != null && Plugin.Instance.cControlWhileDead.Value; } return lp.isPlayerControlled; } private bool LocalDead() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); return (Object)val != (Object)null && val.isPlayerDead; } private bool RangeGatedNow(Cmd c) { if (c.RangeGated) { return true; } if (Plugin.Instance.cLongRangeWalkie != null && Plugin.Instance.cLongRangeWalkie.Value && c.Name != "Go To Bot") { return true; } return false; } private string DisabledReason(Cmd c) { if (c.PlayerBound && LocalDead()) { return c.Name + " needs you alive."; } if (c.NoAllBots && _tIdx >= 0 && _tIdx < _targets.Count && _targets[_tIdx].Kind == TKind.All) { return c.Name + " can't target All Bots. Pick one bot."; } if (RangeGatedNow(c) && TargetTooFar()) { return RangeReason(c); } return c.Name + " can't be used right now."; } private string RangeReason(Cmd c) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown try { PlayerControllerB val = LocalPlayer(); bool flag = Plugin.Instance.cWalkieRange == null || Plugin.Instance.cWalkieRange.Value; bool flag2 = flag && (Object)val != (Object)null && HasActiveWalkie(val); LethalBotAI[] array = ResolveTargets(); if (array != null && array.Length == 1 && (Object)array[0] != (Object)null && array[0].NpcController != null && (Object)array[0].NpcController.Npc != (Object)null) { PlayerControllerB npc = array[0].NpcController.Npc; string playerUsername = npc.playerUsername; bool flag3 = HasWalkieInSlots(npc); if (!flag) { return playerUsername + " is too far away (radio control is off in config)."; } if (!flag2 && !flag3) { return playerUsername + " is too far. Turn your walkie ON, and give " + playerUsername + " a walkie, to reach it by radio."; } if (!flag2) { return playerUsername + " is too far. Turn your walkie ON to reach it by radio (" + playerUsername + " has a walkie)."; } if (!flag3) { return playerUsername + " is too far and has no walkie, so radio can't reach it (your walkie is on)."; } return playerUsername + " is too far away."; } } catch { } return c.Name + ": that bot is too far away. Hold an active walkie (and the bot needs one) to reach it."; } private void Notify(string text) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown try { HUDManager instance = HUDManager.Instance; if ((Object)instance != (Object)null) { instance.DisplayTip("Bot Command", text, false, false, "LBW_botcmd"); } } catch { } } private bool SlotDisabled(Cmd c) { if (c.PlayerBound && LocalDead()) { return true; } if (RangeGatedNow(c) && TargetTooFar()) { return true; } if (c.NoAllBots && _tIdx >= 0 && _tIdx < _targets.Count && _targets[_tIdx].Kind == TKind.All) { return true; } return false; } private bool TargetTooFar() { if (Time.frameCount == _ttfFrame) { return _ttfCache; } _ttfFrame = Time.frameCount; _ttfCache = ComputeTargetTooFar(); return _ttfCache; } private bool ComputeTargetTooFar() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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) float num = ((Plugin.Instance.cFollowRange != null) ? Plugin.Instance.cFollowRange.Value : 0f); if (num <= 0f) { return false; } PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null) { return false; } LethalBotAI[] array = ResolveTargets(); if (array == null || array.Length == 0) { return true; } float num2 = num * num; Vector3 position = ((Component)val).transform.position; bool flag = (Plugin.Instance.cWalkieRange == null || Plugin.Instance.cWalkieRange.Value) && HasActiveWalkie(val); LethalBotAI[] array2 = array; LethalBotAI[] array3 = array2; foreach (LethalBotAI val2 in array3) { if (!((Object)val2 == (Object)null) && val2.NpcController != null && !((Object)val2.NpcController.Npc == (Object)null)) { PlayerControllerB npc = val2.NpcController.Npc; Vector3 val3 = ((Component)npc).transform.position - position; if (((Vector3)(ref val3)).sqrMagnitude <= num2) { return false; } if (flag && HasWalkieInSlots(npc)) { return false; } } } return true; } private static bool HasActiveWalkie(PlayerControllerB p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0071: Expected O, but got Unknown if ((Object)p == (Object)null) { return false; } try { List<WalkieTalkie> allWalkieTalkies = WalkieTalkie.allWalkieTalkies; if (allWalkieTalkies != null) { foreach (WalkieTalkie item in allWalkieTalkies) { if (!((Object)item == (Object)null)) { GrabbableObject val = (GrabbableObject)item; if (val.isBeingUsed && (Object)val.playerHeldBy == (Object)p) { return true; } } } } } catch { } if (p.ItemSlots != null) { GrabbableObject[] itemSlots = p.ItemSlots; foreach (GrabbableObject val2 in itemSlots) { if ((Object)val2 != (Object)null && val2 is WalkieTalkie && val2.isBeingUsed) { return true; } } } return false; } private static bool HasWalkieInSlots(PlayerControllerB p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if ((Object)p == (Object)null || p.ItemSlots == null) { return false; } GrabbableObject[] itemSlots = p.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)val != (Object)null && val is WalkieTalkie) { return true; } } return false; } private LethalBotAI[] OwnedBots() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown LethalBotManager instance = LethalBotManager.Instance; LethalBotAI[] array = (((Object)instance != (Object)null) ? instance.GetLethalBotsAIOwnedByLocal() : null); if (array == null) { return Empty; } List<LethalBotAI> list = new List<LethalBotAI>(array.Length); LethalBotAI[] array2 = array; LethalBotAI[] array3 = array2; foreach (LethalBotAI val in array3) { if (!((Object)val == (Object)null) && !((EnemyAI)val).isEnemyDead) { PlayerControllerB val2 = ((val.NpcController != null) ? val.NpcController.Npc : null); if (!((Object)val2 == (Object)null) && !val2.isPlayerDead) { list.Add(val); } } } return (list.Count > 0) ? list.ToArray() : Empty; } private static string SafeName(LethalBotAI b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown try { if ((Object)b != (Object)null && b.LethalBotIdentity != null) { string name = b.LethalBotIdentity.Name; if (!string.IsNullOrEmpty(name)) { return name; } } } catch { } try { if ((Object)b != (Object)null && b.NpcController != null && (Object)b.NpcController.Npc != (Object)null) { string playerUsername = b.NpcController.Npc.playerUsername; if (!string.IsNullOrEmpty(playerUsername)) { return playerUsername; } } } catch { } return "Bot"; } private void AutoScavengeTick() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Expected O, but got Unknown //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Instance.cAutoScavengeDead == null || !Plugin.Instance.cAutoScavengeDead.Value) { return; } bool flag = LocalDead(); bool flag2 = false; StartOfRound instance = StartOfRound.Instance; if ((Object)instance != (Object)null) { flag2 = instance.shipHasLanded && !instance.inShipPhase && !instance.shipIsLeaving; } PlayerControllerB val = LocalPlayer(); GroupManager instance2 = GroupManager.Instance; LethalBotManager instance3 = LethalBotManager.Instance; LethalBotAI[] array = OwnedBots(); LethalBotAI[] array2 = array; foreach (LethalBotAI val2 in array2) { if ((Object)val2 == (Object)null || val2.State == null) { continue; } string name = ((object)val2.State).GetType().Name; if (!flag) { if (_haulStates.Contains(name)) { _lastTask[val2] = 2; } else if (_scavengeStates.Contains(name)) { _lastTask[val2] = 1; } } else { if (!flag2 || _leaveAloneStates.Contains(name)) { continue; } _lastResume.TryGetValue(val2, out var value); if (Time.time - value < 6f) { continue; } _lastTask.TryGetValue(val2, out var value2); PlayerControllerB val3 = ((val2.NpcController != null) ? val2.NpcController.Npc : null); try { if (value2 == 2) { if ((Object)instance3 != (Object)null && (Object)val3 != (Object)null) { instance3.AddPlayerToLootTransferListAndSync(new NetworkBehaviourReference((NetworkBehaviour)val3)); } val2.State = (AIState)new TransferLootState(val2.State); } else { if ((Object)instance2 != (Object)null && (Object)val != (Object)null && (Object)val3 != (Object)null && instance2.ArePlayersInSameGroup(val3, val)) { instance2.RemoveFromCurrentGroupAndSync(val3); } val2.State = (AIState)new SearchingForScrapState(val2.State, (EntranceTeleport)null); } _lastResume[val2] = Time.time; Plugin.Log.LogInfo((object)("[autoresume] " + SafeName(val2) + " was " + name + " -> resumed " + ((value2 == 2) ? "haul" : "scavenge"))); } catch (Exception ex) { Plugin.Log.LogWarning((object)("[autoresume] " + ex.Message)); } } } if (_lastTask.Count > 48) { _lastTask.Clear(); } if (_lastResume.Count > 48) { _lastResume.Clear(); } } private void Update() { //IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB lp = LocalPlayer(); bool isToggle = Plugin.Instance.IsToggle; if (Time.time >= _nextScavengeTick) { _nextScavengeTick = Time.time + 2f; AutoScavengeTick(); } if (!_open) { if ((isToggle ? Plugin.Instance.IsOpenPressed() : Plugin.Instance.IsOpenHeld()) && CanOpen(lp)) { OpenWheel(lp); } return; } if (!CanOpen(lp)) { CloseWheel(fire: false); return; } Mouse current = Mouse.current; Keyboard current2 = Keyboard.current; if (current != null) { _sel += ((InputControl<Vector2>)(object)((Pointer)current).delta).ReadValue(); float num = CursorMaxR(); if (((Vector2)(ref _sel)).magnitude > num) { _sel *= num / ((Vector2)(ref _sel)).magnitude; } float y = ((InputControl<Vector2>)(object)current.scroll).ReadValue().y; if ((Plugin.Instance.cScrollTarget == null || Plugin.Instance.cScrollTarget.Value) && Mathf.Abs(y) > 0.01f && Time.unscaledTime - _lastScroll > 0.12f && _targets.Count > 0) { int num2 = ((!(y > 0f)) ? 1 : (-1)); if (Plugin.Instance.cInvertScroll.Value) { num2 = -num2; } _tIdx = (_tIdx + num2 + _targets.Count) % _targets.Count; _lastScroll = Time.unscaledTime; RememberTarget(); } } if (_targets.Count > 0) { if (Plugin.Instance.bindNextTarget.Pressed()) { _tIdx = (_tIdx + 1) % _targets.Count; RememberTarget(); } if (Plugin.Instance.bindPrevTarget.Pressed()) { _tIdx = (_tIdx - 1 + _targets.Count) % _targets.Count; RememberTarget(); } } if (_pages.Count > 1) { if (Plugin.Instance.bindNextPage.Pressed()) { _page = (_page + 1) % _pages.Count; _selIndex = -1; } else if (Plugin.Instance.bindPrevPage.Pressed()) { _page = (_page - 1 + _pages.Count) % _pages.Count; _selIndex = -1; } } RecomputeSelection(); int num3 = NumberPressed(current2); if (num3 >= 1 && num3 <= Cur().Count) { Fire(num3 - 1); _selIndex = -1; } if (isToggle ? Plugin.Instance.IsOpenPressed() : (!Plugin.Instance.IsOpenHeld())) { CloseWheel(fire: true); } } private void LateUpdate() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (_open && Plugin.Instance.cFreezeView.Value) { if ((Object)_bodyTf != (Object)null) { _bodyTf.rotation = _bodyRot; } if ((Object)_camTf != (Object)null) { _camTf.localRotation = _camLocalRot; } } } private void OpenWheel(PlayerControllerB lp) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown _open = true; _sel = Vector2.zero; _selIndex = -1; if (_page < 0 || _page >= _pages.Count) { _page = 0; } _bodyTf = ((Component)lp).transform; _camTf = (((Object)lp.gameplayCamera != (Object)null) ? ((Component)lp.gameplayCamera).transform : null); _bodyRot = _bodyTf.rotation; if ((Object)_camTf != (Object)null) { _camLocalRot = _camTf.localRotation; } SuspendGameInput(lp); _targets.Clear(); bool flag = LocalDead(); LethalBotAI val = ((!flag) ? null : SpectatedOwnedBot(lp)); string text = ((!((Object)val != (Object)null)) ? null : SafeName(val)); _targets.Add(new Target { Kind = TKind.All, Label = "All Bots" }); if (!flag) { _targets.Add(new Target { Kind = TKind.Nearest, Label = "Nearest" }); } LethalBotAI[] array = OwnedBots(); int num = -1; LethalBotAI[] array2 = array; foreach (LethalBotAI b in array2) { string text2 = SafeName(b); bool flag2 = text != null && string.Equals(text2, text, StringComparison.OrdinalIgnoreCase); if (flag2) { num = _targets.Count; } _targets.Add(new Target { Kind = TKind.Named, Name = text2, Label = ((!flag2) ? text2 : ("Spectating (" + text2 + ")")) }); } if (num >= 0) { _tIdx = num; return; } _tIdx = 0; for (int j = 0; j < _targets.Count; j++) { Target target = _targets[j]; if (target.Kind == _savedKind && (target.Kind != TKind.Named || string.Equals(target.Name, _savedName, StringComparison.OrdinalIgnoreCase))) { _tIdx = j; break; } } if (flag) { return; } LethalBotAI val2 = GazeBot(lp); if (!((Object)val2 != (Object)null)) { return; } string b2 = SafeName(val2); for (int k = 0; k < _targets.Count; k++) { if (_targets[k].Kind == TKind.Named && string.Equals(_targets[k].Name, b2, StringComparison.OrdinalIgnoreCase)) { _tIdx = k; break; } } } private LethalBotAI SpectatedOwnedBot(PlayerControllerB lp) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0080: 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_0090: Expected O, but got Unknown //IL_0090: Expected O, but got Unknown try { PlayerControllerB val = ((!((Object)lp != (Object)null)) ? null : lp.spectatedPlayerScript); if ((Object)val == (Object)null) { return null; } LethalBotAI[] array = OwnedBots(); LethalBotAI[] array2 = array; foreach (LethalBotAI val2 in array2) { PlayerControllerB val3 = ((val2.NpcController != null) ? val2.NpcController.Npc : null); if ((Object)val3 != (Object)null && (Object)val3 == (Object)val) { return val2; } } } catch { } return null; } private LethalBotAI GazeBot(PlayerControllerB lp) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown try { Camera val = (((Object)lp != (Object)null) ? lp.gameplayCamera : null); LethalBotManager instance = LethalBotManager.Instance; StartOfRound instance2 = StartOfRound.Instance; if ((Object)val == (Object)null || (Object)instance == (Object)null || (Object)instance2 == (Object)null) { return null; } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(((Component)val).transform.position, ((Component)val).transform.forward); RaycastHit[] array = (RaycastHit[])(object)new RaycastHit[8]; int num = Physics.RaycastNonAlloc(val2, array, 40f, instance2.playersMask); float num2 = float.MaxValue; LethalBotAI result = null; for (int i = 0; i < num; i++) { Collider collider = ((RaycastHit)(ref array[i])).collider; if ((Object)collider == (Object)null || !((Component)collider).CompareTag("Player")) { continue; } PlayerControllerB component = ((Component)collider).GetComponent<PlayerControllerB>(); if (!((Object)component == (Object)null)) { LethalBotAI lethalBotAIIfLocalIsOwner = instance.GetLethalBotAIIfLocalIsOwner(component); if ((Object)lethalBotAIIfLocalIsOwner != (Object)null && ((RaycastHit)(ref array[i])).distance < num2) { num2 = ((RaycastHit)(ref array[i])).distance; result = lethalBotAIIfLocalIsOwner; } } } return result; } catch (Exception ex) { Plugin.Log.LogWarning((object)("gaze target: " + ex.Message)); return null; } } private void RememberTarget() { if (_tIdx >= 0 && _tIdx < _targets.Count) { Target target = _targets[_tIdx]; _savedKind = target.Kind; _savedName = target.Name; } } private void CloseWheel(bool fire) { _open = false; ResumeGameInput(); if (fire) { Fire(_selIndex); } _selIndex = -1; } private void SuspendGameInput(PlayerControllerB lp) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown _suspended.Clear(); TrySuspendAsset(InputSystem.actions); try { PlayerActions val = (((Object)lp != (Object)null) ? lp.playerActions : null); TrySuspendAsset((val != null) ? val.asset : null); } catch (Exception ex) { Plugin.Log.LogWarning((object)("suspend input (player asset): " + ex.Message)); } } private void TrySuspendAsset(InputActionAsset asset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) if ((Object)asset == (Object)null) { return; } try { Enumerator<InputActionMap> enumerator = asset.actionMaps.GetEnumerator(); try { while (enumerator.MoveNext()) { InputActionMap current = enumerator.Current; if (current != null && current.enabled) { string text = current.name ?? ""; if (text.IndexOf("menu", StringComparison.OrdinalIgnoreCase) < 0 && text.IndexOf("ui", StringComparison.OrdinalIgnoreCase) < 0 && !_suspended.Contains(current)) { _suspended.Add(current); current.Disable(); } } } } finally { ((IDisposable)enumerator).Dispose(); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("suspend input: " + ex.Message)); } } private void ResumeGameInput() { try { for (int i = 0; i < _suspended.Count; i++) { if (_suspended[i] != null) { _suspended[i].Enable(); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("resume input: " + ex.Message)); } _suspended.Clear(); } private void OnDisable() { if (_open) { _open = false; ResumeGameInput(); } } private static int StableHash(string s) { if (string.IsNullOrEmpty(s)) { return 0; } int num = -2128831035; for (int i = 0; i < s.Length; i++) { num = (num ^ s[i]) * 16777619; } return num; } private string SayLineFor(LethalBotAI bot, string cmdName, string fallback) { if (_persona.TryGetValue(cmdName, out var value) && value != null && value.Length > 0) { return value[(StableHash(SafeName(bot)) & 0x7FFFFFFF) % value.Length]; } return fallback; } private void Fire(int idx) { //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown List<Cmd> list = Cur(); if (idx < 0 || idx >= list.Count) { return; } if (SlotDisabled(list[idx])) { Notify(DisabledReason(list[idx])); return; } LethalBotAI[] array = ResolveTargets(); if (array == null || array.Length == 0) { Notify(list[idx].Name + ": you have no bots to command."); return; } if (list[idx].Single && array != null && array.Length > 1) { LethalBotAI val = NearestBot(array); array = (LethalBotAI[])((!((Object)val != (Object)null)) ? ((Array)Empty) : ((Array)new LethalBotAI[1] { val })); } try { list[idx].Run(array); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Wheel command '" + list[idx].Name + "' failed: " + ex)); } string say = list[idx].Say; if (string.IsNullOrEmpty(say) || array == null) { return; } LethalBotAI[] array2 = array; LethalBotAI[] array3 = array2; foreach (LethalBotAI val2 in array3) { if (!((Object)val2 == (Object)null)) { string text = SayLineFor(val2, list[idx].Name, say); try { val2.SendChatMessage(text, false); } catch (Exception ex2) { Plugin.Log.LogWarning((object)("Wheel confirm chat failed: " + ex2.Message)); } } } } private static int NumberPressed(Keyboard kb) { if (kb == null) { return -1; } if (((ButtonControl)kb.digit1Key).wasPressedThisFrame || ((ButtonControl)kb.numpad1Key).wasPressedThisFrame) { return 1; } if (((ButtonControl)kb.digit2Key).wasPressedThisFrame || ((ButtonControl)kb.numpad2Key).wasPressedThisFrame) { return 2; } if (((ButtonControl)kb.digit3Key).wasPressedThisFrame || ((ButtonControl)kb.numpad3Key).wasPressedThisFrame) { return 3; } if (((ButtonControl)kb.digit4Key).wasPressedThisFrame || ((ButtonControl)kb.numpad4Key).wasPressedThisFrame) { return 4; } if (((ButtonControl)kb.digit5Key).wasPressedThisFrame || ((ButtonControl)kb.numpad5Key).wasPressedThisFrame) { return 5; } if (((ButtonControl)kb.digit6Key).wasPressedThisFrame || ((ButtonControl)kb.numpad6Key).wasPressedThisFrame) { return 6; } if (((ButtonControl)kb.digit7Key).wasPressedThisFrame || ((ButtonControl)kb.numpad7Key).wasPressedThisFrame) { return 7; } if (((ButtonControl)kb.digit8Key).wasPressedThisFrame || ((ButtonControl)kb.numpad8Key).wasPressedThisFrame) { return 8; } return -1; } private LethalBotAI[] ResolveTargets() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown LethalBotAI[] array = OwnedBots(); if (_tIdx < 0 || _tIdx >= _targets.Count) { return array; } Target target = _targets[_tIdx]; if (target.Kind == TKind.All) { return array; } if (target.Kind == TKind.Nearest) { LethalBotAI val = NearestBot(array); return (LethalBotAI[])((!((Object)val != (Object)null)) ? ((Array)Empty) : ((Array)new LethalBotAI[1] { val })); } LethalBotAI[] array2 = array; LethalBotAI[] array3 = array2; foreach (LethalBotAI val2 in array3) { if ((Object)val2 != (Object)null && string.Equals(SafeName(val2), target.Name, StringComparison.OrdinalIgnoreCase)) { return (LethalBotAI[])(object)new LethalBotAI[1] { val2 }; } } return Empty; } private LethalBotAI NearestBot(LethalBotAI[] all) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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) PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null) { return null; } Vector3 position = ((Component)val).transform.position; LethalBotAI result = null; float num = float.MaxValue; foreach (LethalBotAI val2 in all) { if (!((Object)val2 == (Object)null) && val2.NpcController != null && !((Object)val2.NpcController.Npc == (Object)null)) { Vector3 val3 = ((Component)val2.NpcController.Npc).transform.position - position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = val2; } } } return result; } private float CursorMaxR() { float value = Plugin.Instance.cRadius.Value; return Plugin.Instance.cCursorFreeRoam.Value ? Mathf.Max(value + 34f, (float)Mathf.Min(Screen.width, Screen.height) * 0.5f - 12f) : (value + 34f); } private void RecomputeSelection() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) float value = Plugin.Instance.cRadius.Value; float num = Mathf.Max(Plugin.Instance.cDeadzone.Value, (value + 55f) * 0.46f); if (((Vector2)(ref _sel)).magnitude < num) { _selIndex = -1; return; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(_sel.x, 0f - _sel.y); float num2 = Mathf.Atan2(val.y, val.x); int count = Cur().Count; int num3 = 0; float num4 = float.MaxValue; for (int i = 0; i < count; i++) { float num5 = (float)Math.PI * 2f * (float)i / (float)count - (float)Math.PI / 2f; float num6 = Mathf.Abs(Mathf.DeltaAngle(num5 * 57.29578f, num2 * 57.29578f)); if (num6 < num4) { num4 = num6; num3 = i; } } List<Cmd> list = Cur(); if (num3 >= 0 && num3 < list.Count && SlotDisabled(list[num3])) { _selIndex = -1; } else { _selIndex = num3; } } private void EnsureAssets() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_0272: Unknown result type (might be due to invalid IL or missing references) if (!((Object)_solid != (Object)null)) { _solid = new Texture2D(1, 1, (TextureFormat)5, false); _solid.SetPixel(0, 0, Color.white); _solid.Apply(); ((Object)_solid).hideFlags = (HideFlags)61; GUIStyle val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 16; val.fontStyle = (FontStyle)1; _pillDark = val; _pillDark.normal.textColor = new Color(0.84f, 0.89f, 0.94f); _pillSel = new GUIStyle(_pillDark); _pillSel.fontSize = 17; _pillSel.normal.textColor = new Color(0.92f, 0.99f, 1f); _pillDisabled = new GUIStyle(_pillDark); _pillDisabled.normal.textColor = new Color(0.45f, 0.5f, 0.56f, 0.85f); val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 28; val.fontStyle = (FontStyle)1; _center = val; _center.normal.textColor = new Color(0.91f, 0.95f, 1f); val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 19; val.fontStyle = (FontStyle)1; _sub = val; _sub.normal.textColor = new Color(0.55f, 0.86f, 0.62f); val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 14; val.fontStyle = (FontStyle)1; _hint = val; _hint.normal.textColor = new Color(0.51f, 0.56f, 0.62f); val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 13; val.fontStyle = (FontStyle)1; val.richText = true; _status = val; _status.normal.textColor = new Color(0.486f, 0.541f, 0.627f); val = new GUIStyle(); val.alignment = (TextAnchor)4; val.fontSize = 18; val.fontStyle = (FontStyle)1; _num = val; _num.normal.textColor = new Color(0.86f, 0.92f, 0.98f); } } private void EnsureWheels() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown if (_texTried) { return; } _texTried = true; try { string directoryName = Path.GetDirectoryName(typeof(Plugin).Assembly.Location); _texBase = LoadPng(Path.Combine(directoryName, "wheel_base.png")); _texHi = LoadPng(Path.Combine(directoryName, "wheel_hi.png")); _texNum = LoadPng(Path.Combine(directoryName, "wheel_num.png")); Plugin.Log.LogInfo((object)("Wheel textures: base=" + ((Object)_texBase != (Object)null) + " hi=" + ((Object)_texHi != (Object)null) + " num=" + ((Object)_texNum != (Object)null))); } catch (Exception ex) { Plugin.Log.LogWarning((object)("wheel texture load error: " + ex.Message)); } } private static Texture2D LoadPng(string path) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if (!File.Exists(path)) { Plugin.Log.LogWarning((object)("Missing " + Path.GetFileName(path))); return null; } Texture2D val = new Texture2D(2, 2, (TextureFormat)5, false); ((Object)val).hideFlags = (HideFlags)61; if (ImageConversion.LoadImage(val, File.ReadAllBytes(path))) { ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; return val; } Plugin.Log.LogWarning((object)("Failed to decode " + Path.GetFileName(path))); return null; } private void Rect2(Rect r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown GUI.DrawTexture(r, (Texture)_solid); } private void DrawFit(Rect rect, string text, GUIStyle style, float maxW, int baseSize, bool shadow) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0022: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) int fontSize = style.fontSize; style.fontSize = baseSize; float x = style.CalcSize(new GUIContent(text ?? "")).x; if (x > maxW && x > 1f) { style.fontSize = Mathf.Max(9, Mathf.FloorToInt((float)baseSize * (maxW / x))); } if (shadow) { Color textColor = style.normal.textColor; Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.85f * color.a); style.normal.textColor = new Color(0f, 0f, 0f, 1f); Rect val = rect; ((Rect)(ref val)).x = ((Rect)(ref val)).x + 2f; ((Rect)(ref val)).y = ((Rect)(ref val)).y + 2f; GUI.Label(val, text, style); style.normal.textColor = textColor; GUI.color = color; } GUI.Label(rect, text, style); style.fontSize = fontSize; } private void DrawGlow(Rect rect, string text, GUIStyle style, float maxW, int baseSize, Color glow) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) int fontSize = style.fontSize; Color textColor = style.normal.textColor; Color color = GUI.color; style.fontSize = baseSize; float x = style.CalcSize(new GUIContent(text ?? "")).x; if (x > maxW && x > 1f) { style.fontSize = Mathf.Max(9, Mathf.FloorToInt((float)baseSize * (maxW / x))); } style.normal.textColor = new Color(glow.r, glow.g, glow.b, 1f); GUI.color = new Color(1f, 1f, 1f, glow.a * color.a); float[] array = new float[4] { -1f, 1f, 0f, 0f }; float[] array2 = new float[4] { 0f, 0f, -1f, 1f }; for (int i = 0; i < 4; i++) { Rect val = rect; ((Rect)(ref val)).x = ((Rect)(ref val)).x + array[i]; ((Rect)(ref val)).y = ((Rect)(ref val)).y + array2[i]; GUI.Label(val, text, style); } style.normal.textColor = textColor; style.fontSize = fontSize; GUI.color = color; } private static string Abbrev(string s) { if (string.IsNullOrEmpty(s)) { return "?"; } int num = s.IndexOf(' '); string text = ((num > 0) ? s.Substring(0, num) : s); if (text.Length > 9) { text = text.Substring(0, 8) + "."; } return text; } private string WarmChars() { if (_warmChars != null) { return _warmChars; } StringBuilder stringBuilder = new StringBuilder(); foreach (List<Cmd> page in _pages) { foreach (Cmd item in page) { stringBuilder.Append(item.Name).Append(' '); } } stringBuilder.Append("All Bots Nearest none cancel scroll target page "); stringBuilder.Append("◄►· /()|:-.,%'?!$"); stringBuilder.Append("0123456789"); stringBuilder.Append("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); _warmChars = stringBuilder.ToString(); return _warmChars; } private void WarmUp() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0067: 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_0081: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) try { EnsureAssets(); EnsureWheels(); string text = WarmChars(); Font val = (((Object)GUI.skin != (Object)null) ? GUI.skin.font : null); if ((Object)val != (Object)null) { for (int i = 9; i <= 30; i++) { val.RequestCharactersInTexture(text, i, (FontStyle)1); } } Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(-9999f, -9999f, 64f, 64f); if ((Object)_texBase != (Object)null) { GUI.DrawTexture(val2, (Texture)_texBase); } if ((Object)_texHi != (Object)null) { GUI.DrawTexture(val2, (Texture)_texHi); } if ((Object)_texNum != (Object)null) { GUI.DrawTexture(val2, (Texture)_texNum); } Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(-9999f, -9999f, 420f, 30f); GUIStyle[] array = (GUIStyle[])(object)new GUIStyle[8] { _pillDark, _pillSel, _pillDisabled, _center, _sub, _hint, _status, _num }; GUIStyle[] array2 = array; foreach (GUIStyle val4 in array2) { if (val4 != null) { GUI.Label(val3, text, val4); } } GUI.color = color; } catch (Exception ex) { Plugin.Log.LogWarning((object)("wheel warmup: " + ex.Message)); } } private void OnGUI() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Expected O, but got Unknown //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Expected O, but got Unknown //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Unknown result type (might be due to invalid IL or missing references) //IL_0aaf: Unknown result type (might be due to invalid IL or missing references) if (!_open) { if (!_warmed) { _warmed = true; WarmUp(); } return; } EnsureAssets(); Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.15f); Rect2(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height)); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((float)Screen.width / 2f, (float)Screen.height / 2f); float value = Plugin.Instance.cRadius.Value; List<Cmd> list = Cur(); int count = list.Count; EnsureWheels(); float num = (value + 55f) * 2f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(val.x - num / 2f, val.y - num / 2f, num, num); GUI.color = Color.white; if ((Object)_texBase != (Object)null) { GUI.DrawTexture(val2, (Texture)_texBase); if (_selIndex >= 0 && (Object)_texHi != (Object)null) { Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(360f * (float)_selIndex / (float)count, val); GUI.DrawTexture(val2, (Texture)_texHi); GUI.matrix = matrix; } float num2 = value * 0.78f; float num3 = 1.6f * num2 * Mathf.Sin((float)Math.PI / 8f); float num4 = num3 + 24f; float num5 = 42f; float num6 = (value + 55f) * 0.9f; float num7 = Mathf.Clamp((value + 55f) * 0.125f, 26f, 40f); Vector2 val3 = default(Vector2); Rect rect = default(Rect); Rect val4 = default(Rect); for (int i = 0; i < count; i++) { float num8 = (float)Math.PI * 2f * (float)i / (float)count - (float)Math.PI / 2f; ((Vector2)(ref val3))..ctor(Mathf.Cos(num8), Mathf.Sin(num8)); Vector2 val5 = val + val3 * num2; ((Rect)(ref rect))..ctor(val5.x - num4 / 2f, val5.y - num5 / 2f, num4, num5); bool flag = SlotDisabled(list[i]); bool flag2 = i == _selIndex && !flag; GUIStyle style = (flag ? _pillDisabled : (flag2 ? _pillSel : _pillDark)); if (flag2) { DrawGlow(rect, list[i].Name, style, num3, 28, new Color(0.35f, 0.85f, 1f, 0.38f)); } DrawFit(rect, list[i].Name, style, num3, flag2 ? 28 : 26, !flag2 && !flag); Vector2 val6 = val + val3 * num6; ((Rect)(ref val4))..ctor(val6.x - num7 / 2f, val6.y - num7 / 2f, num7, num7); if ((Object)_texNum != (Object)null) { GUI.DrawTexture(val4, (Texture)_texNum); } _num.contentOffset = new Vector2(Plugin.Instance.cNumX.Value, Plugin.Instance.cNumY.Value); GUI.Label(val4, (i + 1).ToString(), _num); } } else { float num9 = 132f; float num10 = 40f; Rect val7 = default(Rect); for (int j = 0; j < count; j++) { float num11 = (float)Math.PI * 2f * (float)j / (float)count - (float)Math.PI / 2f; Vector2 val8 = val + new Vector2(Mathf.Cos(num11), Mathf.Sin(num11)) * value; ((Rect)(ref val7))..ctor(val8.x - num9 / 2f, val8.y - num10 / 2f, num9, num10); bool flag3 = j == _selIndex; GUI.color = (flag3 ? new Color(0.95f, 0.68f, 0.28f, 0.97f) : new Color(0.1f, 0.08f, 0.05f, 0.92f)); Rect2(val7); GUI.color = Color.white; GUI.Label(val7, list[j].Name, flag3 ? _pillSel : _pillDark); } } float num12 = CursorMaxR(); Vector2 val9 = _sel; if (((Vector2)(ref val9)).magnitude > num12) { val9 *= num12 / ((Vector2)(ref val9)).magnitude; } Vector2 val10 = default(Vector2); ((Vector2)(ref val10))..ctor(val.x + val9.x, val.y - val9.y); if (_selIndex < 0) { float num13 = Mathf.Max(6f, Plugin.Instance.cCursorSize.Value); float num14 = num13 * 0.6f; GUI.color = new Color(0f, 0f, 0f, 0.8f); Rect2(new Rect(val10.x - num13 / 2f, val10.y - num13 / 2f, num13, num13)); GUI.color = new Color(0.97f, 0.97f, 0.97f, 0.95f); Rect2(new Rect(val10.x - num14 / 2f, val10.y - num14 / 2f, num14, num14)); } GUI.color = Color.white; string text = ((_selIndex >= 0) ? list[_selIndex].Name : "Cancel"); int num15 = ((_targets.Count <= 0) ? 1 : _targets.Count); string text2 = "All Bots"; if (_tIdx >= 0 && _tIdx < _targets.Count) { Target target = _targets[_tIdx]; if (target.Kind == TKind.Nearest) { LethalBotAI val11 = NearestBot(OwnedBots()); text2 = "Nearest (" + (((Object)val11 != (Object)null) ? Abbrev(SafeName(val11)) : "none") + ")"; } else { text2 = target.Label; } } float num16 = ((Plugin.Instance.cCenterScale == null) ? 1f : Plugin.Instance.cCenterScale.Value); if (num16 < 0.5f) { num16 = 0.5f; } if (num16 > 3f) { num16 = 3f; } float maxW = (value + 55f) * 0.62f; float maxW2 = (value + 55f) * 0.58f; string text3 = "<color=#7C8AA0>TARGET</color> <color=#B9E8F5>" + (_tIdx + 1) + " / " + num15 + "</color>"; if (_pages.Count > 1) { text3 = text3 + " <color=#55606E>·</color> <color=#7C8AA0>PAGE</color> <color=#B9E8F5>" + (_page + 1) + " / " + _pages.Count + "</color>"; } string text4 = null; if (Plugin.Instance.cScrollTarget == null || Plugin.Instance.cScrollTarget.Value) { text4 = "Scroll"; } string text5 = Plugin.Instance.bindNextTarget.Label(); if (!string.IsNullOrEmpty(text5)) { text4 = ((text4 != null) ? (text4 + " / " + text5) : text5); } string text6 = Plugin.Instance.bindNextPage.Label(); string text7 = ""; if (text4 != null) { text7 = "<color=#6A7480>" + text4 + "</color> <color=#464F5A>target</color>"; } if (_pages.Count > 1 && !string.IsNullOrEmpty(text6)) { if (text7.Length > 0) { text7 += " <color=#3A424D>·</color> "; } text7 = text7 + "<color=#6A7480>" + text6 + "</color> <color=#464F5A>page</color>"; } _center.normal.textColor = ((_selIndex >= 0) ? new Color(0.55f, 0.86f, 0.62f) : new Color(0.91f, 0.95f, 1f)); DrawFit(new Rect(val.x - 175f, val.y - 66f, 350f, 42f), text, _center, maxW, Mathf.RoundToInt(27f * num16), shadow: true); DrawFit(new Rect(val.x - 175f, val.y - 26f, 350f, 30f), "◄ " + text2 + " ►", _sub, maxW2, Mathf.RoundToInt(19f * num16), shadow: true); DrawFit(new Rect(val.x - 175f, val.y + 8f, 350f, 22f), text3, _status, maxW, Mathf.RoundToInt(13f * num16), shadow: false); if (text7.Length > 0) { DrawFit(new Rect(val.x - 175f, val.y + 30f, 350f, 20f), text7, _status, maxW, Mathf.RoundToInt(11f * num16), shadow: false); } GUI.color = color; } private void CmdReport(LethalBotAI[] targets) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (targets != null && targets.Length != 0) { LethalBotAI val = targets[0]; int valueOfAllScrapOnShip = LethalBotManager.GetValueOfAllScrapOnShip(val, true); TimeOfDay instance = TimeOfDay.Instance; string text = (((Object)instance != (Object)null) ? $"Ship scrap: ${valueOfAllScrapOnShip}. Quota: ${instance.quotaFulfilled}/${instance.profitQuota}." : $"Ship scrap: ${valueOfAllScrapOnShip}."); val.SendChatMessage(text, false); } } private void CmdRegroup(LethalBotAI[] targets) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null || targets == null) { return; } foreach (LethalBotAI val2 in targets) { if ((Object)val2 != (Object)null) { val2.SyncTeleportLethalBot(((Component)val).transform.position, (bool?)(!val.isInsideFactory), (EntranceTeleport)null, false, 0f, false, false); } } } private void CmdGoToBot(LethalBotAI[] targets) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null || targets == null || targets.Length == 0) { return; } LethalBotAI val2 = NearestBot(targets); if ((Object)val2 == (Object)null || val2.NpcController == null || (Object)val2.NpcController.Npc == (Object)null) { return; } PlayerControllerB npc = val2.NpcController.Npc; Vector3 position = ((Component)npc).transform.position; val.TeleportPlayer(position, false, 0f, false, true); bool isInsideFactory = npc.isInsideFactory; val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = isInsideFactory; try { StartOfRound instance = StartOfRound.Instance; if ((Object)instance != (Object)null && (Object)instance.occlusionCuller != (Object)null && ((Behaviour)instance.occlusionCuller).enabled) { instance.occlusionCuller.SetToStartTile(); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("GoToBot culling refresh: " + ex.Message)); } } private void CmdToShip(LethalBotAI[] targets) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (targets == null) { return; } Vector3 val = ShipPos(); foreach (LethalBotAI val2 in targets) { if ((Object)val2 != (Object)null) { val2.SyncTeleportLethalBot(val, (bool?)true, (EntranceTeleport)null, false, 0f, false, false); } } } private Vector3 ShipPos() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) StartOfRound instance = StartOfRound.Instance; if ((Object)instance != (Object)null) { if ((Object)instance.middleOfShipNode != (Object)null) { return instance.middleOfShipNode.position; } if (instance.playerSpawnPositions != null && instance.playerSpawnPositions.Length > 0 && (Object)instance.playerSpawnPositions[0] != (Object)null) { return instance.playerSpawnPositions[0].position; } if ((Object)instance.elevatorTransform != (Object)null) { return instance.elevatorTransform.position; } } PlayerControllerB val = LocalPlayer(); return ((Object)val != (Object)null) ? ((Component)val).transform.position : Vector3.zero; } private void CmdCollectDelivery(LethalBotAI[] targets) { LethalBotAI[] array = OwnedBots(); if (array != null && array.Length != 0) { if (_collectLatchCo != null) { ((MonoBehaviour)this).StopCoroutine(_collectLatchCo); } _collectLatchCo = ((MonoBehaviour)this).StartCoroutine(CollectRoutine(array)); } } private IEnumerator CollectRoutine(LethalBotAI[] all) { float t = 0f; ItemDropship ship = null; for (; t < 60f; t += 0.25f) { ship = Object.FindObjectOfType<ItemDropship>(); if ((Object)ship != (Object)null && ship.shipLanded) { break; } ship = null; yield return (object)new WaitForSeconds(0.25f); } if ((Object)ship == (Object)null) { _collectLatchCo = null; yield break; } _collectResume.Clear(); LethalBotManager mgr = LethalBotManager.Instance; PlayerControllerB manner = (((Object)mgr != (Object)null) ? mgr.MissionControlPlayer : null); SetCollectLatch(v: true); foreach (LethalBotAI val in all) { if (!((Object)val == (Object)null) && val.State != null) { PlayerControllerB val2 = ((val.NpcController != null) ? val.NpcController.Npc : null); bool wasManning = (Object)manner != (Object)null && (Object)val2 == (Object)manner; _collectResume.Add(new ResumeInfo { bot = val, prev = val.State, wasManning = wasManning }); val.State = (AIState)new CollectPurchasedItemsState(val.State, (AIState)null); try { val.SendChatMessage(SayLineFor(val, "Collect Delivery", "Grabbing the delivery!"), false); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Collect chat failed: " + ex.Message)); } } } WaitForSeconds poll = new WaitForSeconds(1f); for (t = 0f; t < 300f; t += 1f) { ItemDropship ds = Object.FindObjectOfType<ItemDropship>(); if ((Object)ds == (Object)null || !ds.shipLanded) { break; } yield return poll; } SetCollectLatch(v: false); yield return (object)new WaitForSeconds(1.5f); RestoreAfterCollect(); _collectLatchCo = null; } private void RestoreAfterCollect() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown LethalBotManager instance = LethalBotManager.Instance; foreach (ResumeInfo item in _collectResume) { LethalBotAI bot = item.bot; if ((Object)bot == (Object)null || item.prev == null) { continue; } try { bool flag = bot.State is CollectPurchasedItemsState; bool flag2 = bot.State == null || ((object)bot.State).GetType() != ((object)item.prev).GetType(); if (flag || flag2) { if (item.wasManning) { PlayerControllerB val = ((bot.NpcController != null) ? bot.NpcController.Npc : null); if ((Object)instance != (Object)null && (Object)val != (Object)null) { instance.MissionControlPlayer = val; } } bot.State = item.prev; } if (!item.wasManning && bot.State is CollectPurchasedItemsState) { bot.State = (AIState)new SearchingForScrapState(bot.State, (EntranceTeleport)null); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Collect resume failed: " + ex.Message)); } } _collectResume.Clear(); } private static void SetCollectLatch(bool v) { if (!_collectLatchResolved) { _collectLatchResolved = true; try { _collectLatchField = typeof(CollectPurchasedItemsState).GetField("<CollectDeliveredItems>k__BackingField", BindingFlags.Static | BindingFlags.NonPublic); } catch (Exception ex) { Plugin.Log.LogWarning((object)("[wheel] collect-latch reflect failed: " + ex.Message)); } if (_collectLatchField == null) { Plugin.Log.LogWarning((object)"[wheel] collect-latch field not found; Collect Delivery won't work on moons."); } } try { if (_collectLatchField != null) { _collectLatchField.SetValue(null, v); } } catch (Exception ex2) { Plugin.Log.LogWarning((object)("[wheel] collect-latch set failed: " + ex2.Message)); } } private void CmdTransfer(LethalBotAI[] targets) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) LethalBotManager instance = LethalBotManager.Instance; if (targets == null) { return; } foreach (LethalBotAI val in targets) { if (!((Object)val == (Object)null) && val.State != null) { PlayerControllerB val2 = ((val.NpcController != null) ? val.NpcController.Npc : null); if ((Object)instance != (Object)null && (Object)val2 != (Object)null) { instance.AddPlayerToLootTransferListAndSync(new NetworkBehaviourReference((NetworkBehaviour)val2)); } val.State = (AIState)new TransferLootState(val.State); } } } private void CmdLeadWay(LethalBotAI[] targets) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); if (targets == null) { return; } GroupManager instance = GroupManager.Instance; foreach (LethalBotAI val2 in targets) { if (!((Object)val2 == (Object)null) && val2.State != null) { PlayerControllerB val3 = ((val2.NpcController != null) ? val2.NpcController.Npc : null); if ((Object)instance != (Object)null && (Object)val != (Object)null && (Object)val3 != (Object)null && instance.ArePlayersInSameGroup(val3, val)) { instance.RemoveFromCurrentGroupAndSync(val3); } val2.State = (AIState)new SearchingForScrapState(val2.State, (EntranceTeleport)null); } } } private void CmdChangeSuit(LethalBotAI[] targets) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null || targets == null) { return; } int currentSuitID = val.currentSuitID; foreach (LethalBotAI val2 in targets) { if (!((Object)val2 == (Object)null) && val2.NpcController != null && !((Object)val2.NpcController.Npc == (Object)null)) { val2.ChangeSuitLethalBotServerRpc(val2.NpcController.Npc.playerClientId, currentSuitID, true); } } } private void CmdFollow(LethalBotAI[] targets) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); if ((Object)val == (Object)null || targets == null) { return; } GroupManager instance = GroupManager.Instance; foreach (LethalBotAI val2 in targets) { if ((Object)val2 == (Object)null) { continue; } PlayerControllerB val3 = ((val2.NpcController != null) ? val2.NpcController.Npc : null); try { if (val2.IsUsingTerminal() || val2.IsInSpecialAnimation()) { val2.LeaveTerminalRpc(true, true); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Follow leave-terminal: " + ex.Message)); } if ((Object)instance != (Object)null && (Object)val3 != (Object)null) { instance.CreateOrJoinGroupWithMembersAndSync(val, (PlayerControllerB[])(object)new PlayerControllerB[1] { val3 }, false); } val2.SyncAssignTargetAndSetMovingTo(val); } } private void CmdWait(LethalBotAI[] targets) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown if (targets == null) { return; } foreach (LethalBotAI val in targets) { if ((Object)val != (Object)null && val.NpcController != null && (Object)val.NpcController.Npc != (Object)null) { val.State = (AIState)new HoldPositionState(val.State, ((Component)val.NpcController.Npc).transform.position); } } } private void CmdGearUp(LethalBotAI[] targets) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (targets == null) { return; } foreach (LethalBotAI val in targets) { if ((Object)val != (Object)null) { val.State = (AIState)new GrabLoadoutState(val.State, (AIState)null); } } } private void CmdManShip(LethalBotAI[] targets) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown LethalBotManager instance = LethalBotManager.Instance; if (!((Object)instance == (Object)null) && targets != null && targets.Length != 0) { LethalBotAI val = NearestBot(targets); if (!((Object)val == (Object)null) && val.State != null && val.NpcController != null && !((Object)val.NpcController.Npc == (Object)null)) { instance.MissionControlPlayer = val.NpcController.Npc; val.State = (AIState)new MissionControlState(val.State); } } } private void ChatCmd(LethalBotAI[] targets, string keyword) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown PlayerControllerB val = LocalPlayer(); if (targets == null || (Object)val == (Object)null) { return; } foreach (LethalBotAI val2 in targets) { if (!((Object)val2 == (Object)null) && val2.State != null) { try { ChatCommandsManager.OnPl