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 NoxaraAdminMenu v1.0.1
plugins/NoxaraAdminMenu.dll
Decompiled 21 minutes ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using Steamworks; using Steamworks.Data; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Demonbytes")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("NoxaraAdminMenu")] [assembly: AssemblyTitle("NoxaraAdminMenu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DemonBytesHostMenu { [BepInPlugin("demonbytes.repo.noxaraadminmenu", "NoxaraAdminMenu by Demonbytes", "1.0.1")] public sealed class HostMenu : BaseUnityPlugin { private sealed class Upgrade { internal readonly string Name; internal readonly string Key; internal readonly string GameName; internal Upgrade(string name, string gameName) { Name = name; GameName = gameName; Key = "playerUpgrade" + gameName; } } private sealed class SpawnChoice { internal string Name; internal string Path; internal string Group; internal string Size; internal string MonsterName; internal PrefabRef Monster; internal EnemySetup EnemySetup; internal Item Item; internal CosmeticWorldObjectSetup Cosmetic; } private sealed class ExtractionClown { internal ExtractionPoint Point; internal Room Room; internal GameObject Object; internal PhotonView View; internal ClownTrap Trap; internal PhysGrabObject Body; internal PhysGrabObjectGrabArea Nose; internal Rigidbody Rigidbody; internal Vector3 Anchor; internal Quaternion AnchorRotation; internal float NextPress; } private enum ConfirmState { Hidden, Automatic, WaitingForQuota, Ready } private sealed class ExtractionButtonState { internal ExtractionPoint Point; internal StaticGrabObject Grab; internal MeshRenderer Renderer; internal Light Light; internal Material PreviousMaterial; internal Material OurMaterial; internal bool PreviousGrabEnabled; internal bool PreviousLightEnabled; internal Color PreviousColor; internal Color OurColor; internal string PreviousHover; internal string OurHover; internal bool OurGrabEnabled; internal bool OurLightEnabled; } private enum MemberState { Loading, Alive, Dead } private sealed class Member { internal Player Player; internal PlayerAvatar Avatar; internal string Name; internal float JoinedAt; internal float StateAt; internal MemberState State; internal LevelGenerator awaitingGameplay; } private sealed class HistoryEntry { internal DateTime Time; internal string Text; internal float AlertUntil; } private sealed class Join { internal Player Player; internal LevelGenerator Level; internal float Deadline; internal float RetryAt; internal bool ConnectedAvatar; internal bool StartReleased; internal bool ModulesReady; internal bool SpawnSent; internal bool PositionReady; internal bool Slow; internal bool CompletionSent; internal bool NavigationSent; } private sealed class PendingUpgrade { internal PlayerAvatar Owner; internal int[] Before; } private struct ShotDrain { internal bool Paused; internal bool FullBar; internal float Amount; } private sealed class Orb { internal EnemyValuable Marker; internal PhysGrabObject Body; internal ValuableObject Value; internal Collider Shape; internal int Merges; internal float sparkUntil; internal float nextSpark; internal bool IsValid { get { if (Object.op_Implicit((Object)(object)Marker) && Object.op_Implicit((Object)(object)Body) && !Body.dead && Object.op_Implicit((Object)(object)Value) && Object.op_Implicit((Object)(object)Body.photonView)) { return Body.photonView.ViewID > 0; } return false; } } } private sealed class CosmeticCounts { internal int Capacity; internal int Live; internal int Extracted; internal readonly Dictionary<Rarity, int> OnMap = new Dictionary<Rarity, int>(); internal readonly Dictionary<Rarity, int> Allowed = new Dictionary<Rarity, int>(); internal int Free => Math.Max(0, Capacity - Live - Extracted); } private static readonly Upgrade[] Upgrades = new Upgrade[13] { new Upgrade("Health", "Health"), new Upgrade("Stamina", "Stamina"), new Upgrade("Strength", "Strength"), new Upgrade("Range", "Range"), new Upgrade("Speed", "Speed"), new Upgrade("Extra Jump", "ExtraJump"), new Upgrade("Throw Strength", "Throw"), new Upgrade("Map Player Count", "MapPlayerCount"), new Upgrade("Crouch Rest", "CrouchRest"), new Upgrade("Tumble Launch", "Launch"), new Upgrade("Tumble Wings", "TumbleWings"), new Upgrade("Tumble Climb", "TumbleClimb"), new Upgrade("Death Head Battery", "DeathHeadBattery") }; private readonly List<SpawnChoice> spawns = new List<SpawnChoice>(); private bool catalogReady; private RoundDirector haulRound; private int completedPoints; private int settledHaul; private int cachedMapValue; private float mapValueRefresh; private Texture2D brand; private readonly Dictionary<string, RenderTexture> previews = new Dictionary<string, RenderTexture>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<string, Texture> packLabels = new Dictionary<string, Texture>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<string, Sprite> itemIcons = new Dictionary<string, Sprite>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<string, Texture2D> bakedItems = new Dictionary<string, Texture2D>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<Material, Material> previewMaterials = new Dictionary<Material, Material>(); private int previewFrame = -1; private const string ExtractionClownResource = "valuables/03 medium/valuable manor clown"; private const float ConfirmClownSize = 0.55f; private const string ConfirmClownMarker = "demonbytes.repo.noxaraadminmenu.confirm"; private const float NosePressCooldown = 0.65f; private const float MaxClownDrift = 0.65f; private ExtractionClown extractionClown; private ExtractionPoint clownFailedAt; private ExtractionPoint clownPlacementAt; private float clownRetryAt; private int clownPlacementAttempts; private GameObject clownPrefab; private Bounds clownBounds; private const byte ExtractionStateEvent = 175; private const float StateLeaseSeconds = 5f; private const float GrabDistanceMeters = 6f; private ExtractionButtonState confirmButton; private int sentExtractionPoint; private int remoteExtractionPoint; private ConfirmState sentExtractionState; private ConfirmState remoteExtractionState; private float nextExtractionSync; private float remoteExtractionUntil; internal const string Id = "demonbytes.repo.noxaraadminmenu"; internal const string Version = "1.0.1"; internal static HostMenu Instance; private readonly Harmony patches = new Harmony("demonbytes.repo.noxaraadminmenu"); private readonly Harmony joinPatches = new Harmony("demonbytes.repo.noxaraadminmenu.latejoin"); private readonly Dictionary<int, Member> members = new Dictionary<int, Member>(); private readonly List<HistoryEntry> history = new List<HistoryEntry>(); private readonly Dictionary<string, string> bans = new Dictionary<string, string>(StringComparer.Ordinal); private readonly List<InputKey> allowedInputs = new List<InputKey>(); private ConfigEntry<KeyboardShortcut> hotkey; private ConfigEntry<bool> showHud; private ConfigEntry<bool> showAlerts; private ConfigEntry<int> menuOpacity; private ConfigEntry<int> hudOpacity; private ConfigEntry<int> joinNoticeSeconds; private ConfigEntry<int> maximumUpgrade; private ConfigEntry<float> hudPositionX; private ConfigEntry<float> hudPositionY; private Room room; private int masterActor; private LevelGenerator level; private float pollAt; private bool open; private bool forceClosed; private bool manualLobby; private bool lateJoin; private bool available; private string conflict; private string banPath; private string status = "Ready."; private Action pending; private bool? lastSteamAccept; private readonly Dictionary<int, Join> joins = new Dictionary<int, Join>(); private LevelGenerator preparedLevel; private LevelGenerator completionOwned; private LevelGenerator startOwned; private bool joinSupported; private bool sceneTransition; private static readonly string[] Tabs = new string[7] { "Overview", "Players", "Lobby", "Run", "Spawns", "Modules", "Settings" }; private static readonly string[] SpawnGroups = new string[6] { "Items", "Valuables", "Cash Objects", "Cosmetic Boxes", "Monsters", "Upgrade Packs" }; private static readonly string[] SpawnSizes = new string[8] { "All", "Tiny", "Small", "Medium", "Large", "Wide", "Tall", "Very Tall" }; private static readonly Color Teal = new Color(0.36f, 0.89f, 0.79f); private static readonly Color Muted = new Color(0.67f, 0.73f, 0.78f); private static readonly Color Alert = new Color(1f, 0.6f, 0.5f); private readonly Dictionary<string, string> edits = new Dictionary<string, string>(StringComparer.Ordinal); private Rect window; private const int HudWindowId = 777104; private Rect hudWindow; private Vector2 hudAnchor; private bool hudAnchorLoaded; private bool hudMoved; private Vector2 scroll; private GUIStyle selectedTabStyle; private GUIStyle title; private GUIStyle caption; private GUIStyle label; private GUIStyle button; private GUIStyle windowStyle; private Action confirmation; private string confirmationText; private int tab; private int spawnGroup; private int spawnSize; private int selectedActor; private int spawnPage; private string search = ""; private int upgradesFor; private int monsterQuantity = 1; private int spawnMoney = 1000; private ConfigEntry<bool> shareUpgrades; private ConfigEntry<bool> sharedHealth; private ConfigEntry<bool> returnLobby; private ConfigEntry<bool> confirmExtraction; private ConfigEntry<bool> reviveHeads; private ConfigEntry<bool> mergeOrbs; private ConfigEntry<bool> infiniteAmmo; private ConfigEntry<int> sharingChance; private ConfigEntry<int> healthPercent; private ConfigEntry<int> revivePercent; private ConfigEntry<int> orbMergeLimit; private bool upgradesSupported; private bool packsSupported; private bool confirmSupported; private bool orbsSupported; private bool ammoSupported; private bool headsSupported; private ExtractionPoint confirmedExtraction; private readonly Dictionary<int, float> reviveSince = new Dictionary<int, float>(); private readonly int[] teamUpgrades = new int[Upgrades.Length]; private readonly Dictionary<string, int[]> teamCredits = new Dictionary<string, int[]>(StringComparer.Ordinal); private readonly Dictionary<int, Orb> enemyOrbs = new Dictionary<int, Orb>(); private readonly HashSet<(int, int)> orbContacts = new HashSet<(int, int)>(); private float nextOrbCheck; private bool ownsOverlayCursor; private bool savedCursorVisible; private CursorLockMode savedCursorLock; private PlayerAvatar equipmentOwner; private string[] equipmentNames = Array.Empty<string>(); private float equipmentRefreshAt; private const string CapabilityKey = "demonbytes.noxaraadminmenu"; private const byte ProtectionEvent = 173; private readonly HashSet<int> god = new HashSet<int>(); private readonly HashSet<int> noTumble = new HashSet<int>(); private readonly HashSet<int> noTarget = new HashSet<int>(); private readonly HashSet<int> unlimitedStamina = new HashSet<int>(); private readonly HashSet<string> ownedIgnoredSteamIds = new HashSet<string>(StringComparer.Ordinal); private EnemyDirector ignoreDirector; private bool godSupported; private bool tumbleSupported; private bool targetSupported; private bool staminaSupported; private float godUntil; private float staminaUntil; private float nextGrant; private CosmeticCounts cosmeticCounts = new CosmeticCounts(); private LevelGenerator cosmeticCountLevel; private float cosmeticScanAt; private float nextEnemySpawn; private bool enemySpawnInProgress; private readonly Dictionary<string, int> boxQuantity = new Dictionary<string, int>(StringComparer.Ordinal); private readonly HashSet<ValuableVolume> usedLootVolumes = new HashSet<ValuableVolume>(); internal bool IsHost { get { if (available && room != null && room == PhotonNetwork.CurrentRoom && PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { return room.MasterClientId == masterActor; } return false; } } private bool Ready { get { if (IsHost && Object.op_Implicit((Object)(object)level) && level.Generated && (Object)(object)LevelGenerator.Instance == (Object)(object)level && Object.op_Implicit((Object)(object)RunManager.instance) && !RunManager.instance.restarting) { return !RunManager.instance.SceneHandoffActive; } return false; } } private static bool InEntryLobby { get { if (Object.op_Implicit((Object)(object)RunManager.instance)) { if (!SemiFunc.RunIsLobbyMenu()) { return SemiFunc.RunIsLobby(); } return true; } return false; } } private bool CanLateJoin { get { if (joinSupported && Ready && (Object)(object)preparedLevel == (Object)(object)level && (Object)(object)completionOwned == (Object)(object)level && (Object)(object)startOwned == (Object)(object)level) { if (!SemiFunc.RunIsLevel()) { return SemiFunc.RunIsShop(); } return true; } return false; } } private bool WantsOverlayCursor { get { if (open && Application.isFocused) { if (!IsHost) { return !available; } return true; } return false; } } private static int UpgradeLevel(Upgrade upgrade, PlayerAvatar avatar) { if (!Object.op_Implicit((Object)(object)StatsManager.instance) || !Object.op_Implicit((Object)(object)avatar) || string.IsNullOrEmpty(avatar.steamID) || !StatsManager.instance.dictionaryOfDictionaries.TryGetValue(upgrade.Key, out var value)) { return 0; } return value.GetValueOrDefault(avatar.steamID); } private void ApplyUpgrade(PlayerAvatar avatar, Upgrade upgrade, int value) { if (Ready && Object.op_Implicit((Object)(object)avatar) && Object.op_Implicit((Object)(object)PunManager.instance) && Object.op_Implicit((Object)(object)StatsManager.instance) && !string.IsNullOrEmpty(avatar.steamID) && StatsManager.instance.dictionaryOfDictionaries.TryGetValue(upgrade.Key, out var value2)) { int valueOrDefault = value2.GetValueOrDefault(avatar.steamID); value = Mathf.Clamp(value, 0, UpgradeEditorMaximum(valueOrDefault)); int num = value - valueOrDefault; if (num != 0) { PunManager.instance.photonView.RPC("TesterUpgradeCommandRPC", (RpcTarget)0, new object[3] { avatar.steamID, upgrade.GameName, num }); } } } private int UpgradeEditorMaximum(int current) { return Math.Max(current, maximumUpgrade.Value); } private void SelectedAction(int actor, Action<Member> action, bool needsAvatar = true) { Queue(delegate { if (!TryMember(actor, out var member) || (needsAvatar && (!Object.op_Implicit((Object)(object)member.Avatar) || Actor(member.Avatar) != actor || member.State == MemberState.Loading))) { Report("The player is unavailable or still loading."); } else { action(member); } }, needsAvatar); } private void Revive(PlayerAvatar avatar, int percent = 0) { if (!Ready || !Object.op_Implicit((Object)(object)avatar) || !avatar.deadSet || !Object.op_Implicit((Object)(object)avatar.playerDeathHead) || !Object.op_Implicit((Object)(object)avatar.tumble) || !Object.op_Implicit((Object)(object)avatar.playerHealth)) { Report("Revive is unavailable until the player and death head are ready."); return; } bool inExtractionPoint = avatar.playerDeathHead.inExtractionPoint; try { avatar.playerDeathHead.inExtractionPoint = true; avatar.Revive(false); } finally { if (Object.op_Implicit((Object)(object)avatar.playerDeathHead)) { avatar.playerDeathHead.inExtractionPoint = inExtractionPoint; } } if (percent > 0) { avatar.playerHealth.HealOther(Math.Max(0, avatar.playerHealth.maxHealth * percent / 100 - 1), true); } Report(avatar.deadSet ? "Revive requested. Check the player's status." : "Revive confirmed."); } private void ReturnPlayerToTruck(PlayerAvatar avatar) { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)TruckSafetySpawnPoint.instance)) { Report("This level has no truck spawn point."); return; } Transform transform = ((Component)TruckSafetySpawnPoint.instance).transform; if (avatar.deadSet && Object.op_Implicit((Object)(object)avatar.playerDeathHead) && Object.op_Implicit((Object)(object)avatar.playerDeathHead.physGrabObject)) { avatar.playerDeathHead.physGrabObject.Teleport(transform.position, transform.rotation); } else if (!avatar.deadSet) { avatar.Spawn(transform.position, transform.rotation, false); } } private void TeleportToPlayer(PlayerAvatar target) { //IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance) || !Object.op_Implicit((Object)(object)target) || (Object)(object)target == (Object)(object)instance) { return; } Transform val = ((target.deadSet && Object.op_Implicit((Object)(object)target.playerDeathHead)) ? ((Component)target.playerDeathHead).transform : ((Component)target).transform); Vector3 val2 = Vector3.ProjectOnPlane(val.right, Vector3.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3[] array = (Vector3[])(object)new Vector3[4] { normalized, -normalized, -val.forward, val.forward }; RaycastHit val4 = default(RaycastHit); for (int i = 0; i < array.Length; i++) { val2 = Vector3.ProjectOnPlane(array[i], Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized * 1.1f; if (((Vector3)(ref val3)).sqrMagnitude < 0.1f || !Physics.Raycast(val.position + val3 + Vector3.up, Vector3.down, ref val4, 2.5f, -5, (QueryTriggerInteraction)1) || ((RaycastHit)(ref val4)).normal.y < 0.75f) { continue; } Vector3 val5 = ((RaycastHit)(ref val4)).point + Vector3.up * 0.15f; if (Physics.CheckCapsule(val5 + Vector3.up * 0.27f, val5 + Vector3.up * 0.84f, 0.24f, -5, (QueryTriggerInteraction)1)) { continue; } if (instance.deadSet) { if (Object.op_Implicit((Object)(object)instance.playerDeathHead) && Object.op_Implicit((Object)(object)instance.playerDeathHead.physGrabObject)) { instance.playerDeathHead.physGrabObject.Teleport(val5, val.rotation); } } else { instance.Spawn(val5, Quaternion.Euler(0f, val.eulerAngles.y, 0f), false); } return; } Report("No clear floor beside that player."); } private void SetMoney(int amount, bool add) { if (!Object.op_Implicit((Object)(object)PunManager.instance) || !Object.op_Implicit((Object)(object)StatsManager.instance)) { Report("The team balance is still loading."); return; } int valueOrDefault = StatsManager.instance.runStats.GetValueOrDefault("currency"); int num = (int)Math.Clamp(add ? ((long)valueOrDefault + (long)amount) : amount, 0L, 9999999L); int num2 = PunManager.instance.SetRunStatSet("currency", num); if (SemiFunc.RunIsShop() && Object.op_Implicit((Object)(object)ShopManager.instance)) { ShopManager.instance.totalCurrency = num2; } Report($"Team money set to ${num2:N0}."); } private void OpenExtraction() { RoundDirector instance = RoundDirector.instance; if (!Object.op_Implicit((Object)(object)instance) || instance.extractionPointActive) { Report("An extraction is already active."); return; } ExtractionPoint val = (from x in instance.extractionPointList where Object.op_Implicit((Object)(object)x) select x.GetComponent<ExtractionPoint>()).FirstOrDefault((Func<ExtractionPoint, bool>)((ExtractionPoint x) => Object.op_Implicit((Object)(object)x) && x.StateIs((State)1))); if (Object.op_Implicit((Object)(object)val)) { val.OnClick(); } else { Report("No other extraction point is available."); } } private void FinishExtraction(bool waiveQuota) { RoundDirector instance = RoundDirector.instance; if (!Object.op_Implicit((Object)(object)instance) || !instance.extractionPointActive || !Object.op_Implicit((Object)(object)instance.extractionPointCurrent) || !instance.extractionPointCurrent.StateIs((State)2)) { Report("No extraction point is active."); return; } ExtractionPoint extractionPointCurrent = instance.extractionPointCurrent; if (!waiveQuota && (!extractionPointCurrent.haulGoalFetched || extractionPointCurrent.haulCurrent < extractionPointCurrent.haulGoal)) { Report("The extraction quota has not been met."); return; } if (!waiveQuota) { ConfirmExtractionPoint(extractionPointCurrent); return; } extractionPointCurrent.isCompletedRightAway = true; extractionPointCurrent.StateSet((State)6); if (extractionPointCurrent.settingState || !extractionPointCurrent.StateIs((State)2)) { RemoveExtractionClown(); } } private void ResetSpawnCatalog() { ClearPreviews(); spawns.Clear(); catalogReady = false; } private void DiscoverSpawns() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Invalid comparison between Unknown and I4 //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Invalid comparison between Unknown and I4 ResetSpawnCatalog(); if (!Ready) { return; } HashSet<string> keys = new HashSet<string>(StringComparer.Ordinal); if (Object.op_Implicit((Object)(object)StatsManager.instance)) { foreach (Item value in StatsManager.instance.itemDictionary.Values) { if (Object.op_Implicit((Object)(object)value) && !value.disabled && value.prefab != null && ((PrefabRef<GameObject>)(object)value.prefab).IsValid()) { Add(value.itemName, ((PrefabRef<GameObject>)(object)value.prefab).ResourcePath, ((int)value.itemType == 4 || (int)value.itemType == 3) ? "Upgrade Packs" : "Items", "", value); } } } if (Object.op_Implicit((Object)(object)level.Level) && level.Level.ValuablePresets != null) { foreach (LevelValuables valuablePreset in level.Level.ValuablePresets) { if (!Object.op_Implicit((Object)(object)valuablePreset)) { continue; } List<PrefabRef>[] array = new List<PrefabRef>[7] { valuablePreset.tiny, valuablePreset.small, valuablePreset.medium, valuablePreset.big, valuablePreset.wide, valuablePreset.tall, valuablePreset.veryTall }; for (int i = 0; i < array.Length; i++) { if (array[i] == null) { continue; } foreach (PrefabRef item in array[i]) { if (item != null && ((PrefabRef<GameObject>)(object)item).IsValid()) { Add(((PrefabRef<GameObject>)(object)item).PrefabName, ((PrefabRef<GameObject>)(object)item).ResourcePath, "Valuables", SpawnSizes[i + 1]); } } } } } if (Object.op_Implicit((Object)(object)AssetManager.instance)) { GameObject[] array2 = (GameObject[])(object)new GameObject[3] { AssetManager.instance.surplusValuableSmall, AssetManager.instance.surplusValuableMedium, AssetManager.instance.surplusValuableBig }; for (int j = 0; j < array2.Length; j++) { if (Object.op_Implicit((Object)(object)array2[j])) { Add("Surplus cash " + SpawnSizes[j + 2], "Valuables/" + ((Object)array2[j]).name, "Cash Objects", SpawnSizes[j + 2]); } } } AddEnemyChoices(); AddCosmeticChoices(); spawns.Sort((SpawnChoice a, SpawnChoice b) => StringComparer.OrdinalIgnoreCase.Compare(a.Name, b.Name)); catalogReady = true; void Add(string name, string path, string group, string size = "", Item item = null) { if (!string.IsNullOrEmpty(path) && keys.Add(path)) { spawns.Add(new SpawnChoice { Name = name, Path = path, Group = group, Size = size, Item = item }); } } } private GameObject SpawnObject(SpawnChoice entry, int cash, float lateral = 0f) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)PlayerAvatar.instance) || PlayerAvatar.instance.deadSet || !Object.op_Implicit((Object)(object)PlayerController.instance)) { Report("The host must be alive to spawn objects."); return null; } Transform transform = ((Component)PlayerController.instance).transform; Vector3 val = Vector3.ProjectOnPlane(transform.forward, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.1f) { val2 = Vector3.forward; } RaycastHit val3 = default(RaycastHit); if (!Physics.Raycast(transform.position + val2 * 1.5f + Vector3.Cross(Vector3.up, val2) * lateral + Vector3.up, Vector3.down, ref val3, 3f, -5, (QueryTriggerInteraction)1)) { Report("No floor at the spawn point. Move to a clear area."); return null; } GameObject val4 = PhotonNetwork.InstantiateRoomObject(entry.Path, ((RaycastHit)(ref val3)).point + Vector3.up * 0.65f, Quaternion.LookRotation(val2), (byte)0, (object[])null); if (!Object.op_Implicit((Object)(object)val4)) { Report("This object could not spawn in the current level."); return null; } ValuableObject val5 = default(ValuableObject); if (entry.Group == "Cash Objects" && val4.TryGetComponent<ValuableObject>(ref val5)) { val5.dollarValueOverride = Mathf.Clamp(cash, 1, 999999); } Report(entry.Name + " spawned."); return val4; } private void PollRoundHaul() { RoundDirector instance = RoundDirector.instance; if (Ready && Object.op_Implicit((Object)(object)instance) && SemiFunc.RunIsLevel()) { if ((Object)(object)instance != (Object)(object)haulRound) { haulRound = instance; completedPoints = instance.extractionPointsCompleted; settledHaul = instance.totalHaul; mapValueRefresh = 0f; } if (instance.extractionPointsCompleted > completedPoints) { completedPoints = instance.extractionPointsCompleted; AddHistory($"Extraction {completedPoints}/{instance.extractionPoints} completed · ${instance.totalHaul - settledHaul:N0} delivered."); settledHaul = instance.totalHaul; } } } private int MapValue() { if (Time.unscaledTime < mapValueRefresh) { return cachedMapValue; } mapValueRefresh = Time.unscaledTime + 0.5f; cachedMapValue = (Object.op_Implicit((Object)(object)ValuableDirector.instance) ? ValuableDirector.instance.valuableList.Where((ValuableObject v) => Object.op_Implicit((Object)(object)v) && ((Behaviour)v).isActiveAndEnabled && (!Object.op_Implicit((Object)(object)v.physGrabObject) || !v.physGrabObject.dead)).Sum((ValuableObject v) => Mathf.RoundToInt(v.dollarValueCurrent)) : 0); return cachedMapValue; } private void DrawBrand() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)brand)) { using Stream stream = typeof(HostMenu).Assembly.GetManifestResourceStream("Noxara.icon"); if (stream == null) { return; } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); brand = new Texture2D(2, 2); ImageConversion.LoadImage(brand, memoryStream.ToArray(), true); } GUI.DrawTexture(GUILayoutUtility.GetRect(34f, 34f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(34f), GUILayout.Height(34f) }), (Texture)(object)brand, (ScaleMode)2); } private void DrawPreview(SpawnChoice entry) { //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030c: 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) bool flag = entry.Monster != null; float num = (flag ? 52f : 36f); Rect rect = GUILayoutUtility.GetRect(num, num, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(num), GUILayout.Height(num) }); if ((int)Event.current.type != 7 || (entry.Cosmetic != null && DrawBoxIcon(rect, entry.Cosmetic.rarity))) { return; } if (!previews.TryGetValue(entry.Path, out var value) && previewFrame != Time.frameCount) { previewFrame = Time.frameCount; try { GameObject val = (Object.op_Implicit((Object)(object)entry.Item) ? ((PrefabRef<GameObject>)(object)entry.Item.prefab).Prefab : (((PrefabRef<GameObject>)(object)entry.Monster)?.Prefab ?? Resources.Load<GameObject>(entry.Path))); EnemyParent val2 = default(EnemyParent); if (flag && Object.op_Implicit((Object)(object)val) && val.TryGetComponent<EnemyParent>(ref val2) && !string.IsNullOrWhiteSpace(val2.enemyName) && !entry.Name.EndsWith("Director", StringComparison.OrdinalIgnoreCase)) { entry.MonsterName = val2.enemyName; } Sprite val3 = ((!Object.op_Implicit((Object)(object)val)) ? null : val.GetComponentInChildren<ItemAttributes>(true)?.icon); if (!Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val) && !Object.op_Implicit((Object)(object)entry.Item)) { val3 = val.GetComponentInChildren<ItemEquippable>(true)?.ItemIcon; } Texture val4 = ((entry.Group == "Upgrade Packs" && Object.op_Implicit((Object)(object)val)) ? FindPackLabel(val) : null); Texture2D val5 = ((Object.op_Implicit((Object)(object)entry.Item) && Object.op_Implicit((Object)(object)val)) ? LoadBakedItem(entry.Item, val) : null); if (Object.op_Implicit((Object)(object)val5)) { bakedItems[entry.Path] = val5; } else if (Object.op_Implicit((Object)(object)val4)) { packLabels[entry.Path] = val4; } else if (Object.op_Implicit((Object)(object)val3) && !val3.packed) { itemIcons[entry.Path] = val3; } else { value = RenderPreview(val, entry.Monster != null); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogDebug((object)("Preview " + entry.Path + ": " + ex.Message)); } previews[entry.Path] = value; } Texture value3; Sprite value4; if (bakedItems.TryGetValue(entry.Path, out var value2)) { GUI.DrawTexture(rect, (Texture)(object)value2, (ScaleMode)2); } else if (packLabels.TryGetValue(entry.Path, out value3)) { GUI.DrawTextureWithTexCoords(rect, value3, new Rect(0.5f, 0.015f, 0.49f, 0.51f)); } else if (itemIcons.TryGetValue(entry.Path, out value4) && Object.op_Implicit((Object)(object)value4) && Object.op_Implicit((Object)(object)value4.texture)) { Rect textureRect = value4.textureRect; Texture2D texture = value4.texture; GUI.DrawTextureWithTexCoords(rect, (Texture)(object)texture, new Rect(((Rect)(ref textureRect)).x / (float)((Texture)texture).width, ((Rect)(ref textureRect)).y / (float)((Texture)texture).height, ((Rect)(ref textureRect)).width / (float)((Texture)texture).width, ((Rect)(ref textureRect)).height / (float)((Texture)texture).height)); } else if (Object.op_Implicit((Object)(object)value)) { GUI.DrawTextureWithTexCoords(rect, (Texture)(object)value, SystemInfo.graphicsUVStartsAtTop ? new Rect(0f, 1f, 1f, -1f) : new Rect(0f, 0f, 1f, 1f)); } } private static Texture2D LoadBakedItem(Item item, GameObject model) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown string path = Path.Combine(Application.streamingAssetsPath, SemiIconMaker.BakedIconPath("Items", ((Object)item).name + "|" + ((Object)model).name)); if (!File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array, true)) { return val; } Object.Destroy((Object)(object)val); return null; } private static Texture FindPackLabel(GameObject model) { MeshRenderer[] componentsInChildren = model.GetComponentsInChildren<MeshRenderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = ((Renderer)componentsInChildren[i]).sharedMaterials; foreach (Material val in sharedMaterials) { if (!Object.op_Implicit((Object)(object)val)) { continue; } string[] array = new string[3] { "_MainTex", "_AlbedoTexture", "_BaseMap" }; foreach (string text in array) { Texture val2 = (val.HasProperty(text) ? val.GetTexture(text) : null); if (Object.op_Implicit((Object)(object)val2) && ((Object)val2).name.StartsWith("Upgrade_", StringComparison.OrdinalIgnoreCase) && ((Object)val2).name.EndsWith("_Albedo", StringComparison.OrdinalIgnoreCase)) { return val2; } } } } return null; } private static bool DrawBoxIcon(Rect rect, Rarity rarity) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected I4, 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) CosmeticWorldObjectUI instance = CosmeticWorldObjectUI.instance; if (!Object.op_Implicit((Object)(object)instance) || !Object.op_Implicit((Object)(object)instance.elementPrefab)) { return false; } CosmeticWorldObjectUIElement component = instance.elementPrefab.GetComponent<CosmeticWorldObjectUIElement>(); RawImage component2 = instance.elementPrefab.GetComponent<RawImage>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2) || !Object.op_Implicit((Object)(object)component2.texture)) { return false; } Color color = GUI.color; GUI.color = (Color)((rarity - 1) switch { 0 => component.colorUncommon, 1 => component.colorRare, 2 => component.colorUltraRare, _ => component.colorCommon, }); GUI.DrawTextureWithTexCoords(rect, component2.texture, component2.uvRect); GUI.color = color; return true; } private Material PreviewMaterial(Material source) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_008d: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (previewMaterials.TryGetValue(source, out var value)) { return value; } Texture val = null; string text = null; string[] array = new string[3] { "_AlbedoTexture", "_BaseMap", "_MainTex" }; foreach (string text2 in array) { if (source.HasProperty(text2) && Object.op_Implicit((Object)(object)(val = source.GetTexture(text2)))) { text = text2; break; } } Shader val2 = Shader.Find("Legacy Shaders/VertexLit"); if (!Object.op_Implicit((Object)(object)val2)) { return null; } Material val3 = new Material(val2); Color val4 = Color.white; array = new string[3] { "_BaseColor", "_AlbedoColor", "_Color" }; foreach (string text3 in array) { if (source.HasProperty(text3)) { val4 = source.GetColor(text3); break; } } val4.a = 1f; val3.SetColor("_Emission", val4 * 0.42f); val3.SetColor("_SpecColor", Color.black); val3.color = Color.black; val3.mainTexture = (Texture)(Object.op_Implicit((Object)(object)val) ? ((object)val) : ((object)Texture2D.whiteTexture)); if (Object.op_Implicit((Object)(object)val)) { val3.mainTextureOffset = source.GetTextureOffset(text); val3.mainTextureScale = source.GetTextureScale(text); } previewMaterials[source] = val3; return val3; } private RenderTexture RenderPreview(GameObject model, bool monster) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_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_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_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Expected O, but got Unknown //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0356: 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_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)model)) { return null; } EnemyParent val = (monster ? model.GetComponent<EnemyParent>() : null); GameObject val2 = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.EnableObject)) ? val.EnableObject : model); List<(Mesh, Matrix4x4, Material[])> list = new List<(Mesh, Matrix4x4, Material[])>(); List<Mesh> list2 = new List<Mesh>(); Quaternion val3 = Quaternion.LookRotation(new Vector3(-0.44f, -0.18f, -1f)); if (monster) { val3 = Quaternion.AngleAxis(180f, Vector3.up) * val3; } Matrix4x4 val4 = Matrix4x4.Rotate(Quaternion.Inverse(val3)); Bounds val5 = default(Bounds); try { Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>(true); foreach (Renderer val6 in componentsInChildren) { if (!val6.enabled || HiddenPreviewPart(((Component)val6).transform, val2.transform)) { continue; } SkinnedMeshRenderer val7 = (SkinnedMeshRenderer)(object)((val6 is SkinnedMeshRenderer) ? val6 : null); Mesh val8; if (val7 != null && Object.op_Implicit((Object)(object)val7.sharedMesh)) { val8 = new Mesh(); list2.Add(val8); val7.BakeMesh(val8); val8.RecalculateBounds(); } else { object obj; if (!(val6 is MeshRenderer)) { obj = null; } else { MeshFilter component = ((Component)val6).GetComponent<MeshFilter>(); obj = ((component != null) ? component.sharedMesh : null); } val8 = (Mesh)obj; } if (!Object.op_Implicit((Object)(object)val8) || val8.vertexCount == 0) { continue; } Matrix4x4 localToWorldMatrix = val6.localToWorldMatrix; Matrix4x4 val9 = val4 * localToWorldMatrix; Bounds bounds = val8.bounds; for (int j = 0; j < 8; j++) { Vector3 val10 = ((Matrix4x4)(ref val9)).MultiplyPoint3x4(new Vector3(((j & 1) == 0) ? ((Bounds)(ref bounds)).min.x : ((Bounds)(ref bounds)).max.x, ((j & 2) == 0) ? ((Bounds)(ref bounds)).min.y : ((Bounds)(ref bounds)).max.y, ((j & 4) == 0) ? ((Bounds)(ref bounds)).min.z : ((Bounds)(ref bounds)).max.z)); if (list.Count == 0 && j == 0) { val5 = new Bounds(val10, Vector3.zero); } else { ((Bounds)(ref val5)).Encapsulate(val10); } } list.Add((val8, localToWorldMatrix, val6.sharedMaterials)); } if (list.Count != 0) { Vector3 size = ((Bounds)(ref val5)).size; if (!(((Vector3)(ref size)).sqrMagnitude < 0.0001f)) { float num = Mathf.Max(new float[3] { ((Bounds)(ref val5)).extents.x, ((Bounds)(ref val5)).extents.y, 0.01f }) * 1.06f; float num2 = Mathf.Max(((Bounds)(ref val5)).extents.z, num); Vector3 val11 = val3 * (((Bounds)(ref val5)).center - Vector3.forward * num2 * 3f); Matrix4x4 val12 = Matrix4x4.Scale(new Vector3(1f, 1f, -1f)); Matrix4x4 val13 = Matrix4x4.TRS(val11, val3, Vector3.one); Matrix4x4 val14 = val12 * ((Matrix4x4)(ref val13)).inverse; Matrix4x4 val15 = Matrix4x4.Ortho(0f - num, num, 0f - num, num, num2 * 0.1f, num2 * 6f); RenderTexture val16 = new RenderTexture(96, 96, 16, (RenderTextureFormat)0); try { CommandBuffer val17 = new CommandBuffer(); try { val17.SetRenderTarget(RenderTargetIdentifier.op_Implicit((Texture)(object)val16)); val17.ClearRenderTarget(true, true, Color.clear); val17.SetViewProjectionMatrices(val14, GL.GetGPUProjectionMatrix(val15, true)); foreach (var item in list) { for (int k = 0; k < Math.Min(item.Item1.subMeshCount, item.Item3.Length); k++) { Material val18 = (Object.op_Implicit((Object)(object)item.Item3[k]) ? PreviewMaterial(item.Item3[k]) : null); if (Object.op_Implicit((Object)(object)val18)) { val17.DrawMesh(item.Item1, item.Item2, val18, k, 0); } } } Graphics.ExecuteCommandBuffer(val17); return val16; } finally { ((IDisposable)val17)?.Dispose(); } } catch { Object.Destroy((Object)(object)val16); throw; } } } return null; } finally { foreach (Mesh item2 in list2) { Object.Destroy((Object)(object)item2); } } } private static bool HiddenPreviewPart(Transform part, Transform root) { Transform val = part; while (Object.op_Implicit((Object)(object)val) && (Object)(object)val != (Object)(object)root) { if (!((Component)val).gameObject.activeSelf || ((Object)val).name.IndexOf("collider", StringComparison.OrdinalIgnoreCase) >= 0 || ((Object)val).name.IndexOf("particle", StringComparison.OrdinalIgnoreCase) >= 0) { return true; } val = val.parent; } return false; } private void ClearPreviews() { foreach (RenderTexture value in previews.Values) { if (Object.op_Implicit((Object)(object)value)) { value.Release(); Object.Destroy((Object)(object)value); } } previews.Clear(); itemIcons.Clear(); foreach (Texture2D value2 in bakedItems.Values) { Object.Destroy((Object)(object)value2); } bakedItems.Clear(); packLabels.Clear(); foreach (Material value3 in previewMaterials.Values) { Object.Destroy((Object)(object)value3); } previewMaterials.Clear(); } private bool ClownAvailableAt(ExtractionPoint point) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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) ExtractionClown extractionClown = this.extractionClown; if (extractionClown != null && extractionClown.Room == room && (Object)(object)extractionClown.Point == (Object)(object)point && Object.op_Implicit((Object)(object)extractionClown.Object) && Object.op_Implicit((Object)(object)extractionClown.View) && extractionClown.View.IsMine && extractionClown.View.ViewID > 0 && (Object)(object)PhotonView.Find(extractionClown.View.ViewID) == (Object)(object)extractionClown.View && Object.op_Implicit((Object)(object)extractionClown.Body) && !extractionClown.Body.dead && Object.op_Implicit((Object)(object)extractionClown.Nose) && Object.op_Implicit((Object)(object)extractionClown.Rigidbody)) { Vector3 val = extractionClown.Rigidbody.position - extractionClown.Anchor; return ((Vector3)(ref val)).sqrMagnitude <= 0.42249995f; } return false; } private void TickExtractionClown() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Invalid comparison between Unknown and I4 ExtractionPoint val = ((Ready && Object.op_Implicit((Object)(object)RoundDirector.instance)) ? RoundDirector.instance.extractionPointCurrent : null); if (!confirmSupported || !confirmExtraction.Value || !Object.op_Implicit((Object)(object)val) || val.isShop || val.isLocked || !val.StateIs((State)2) || val.settingState || (int)val.stateSetTo != 0) { RemoveExtractionClown(); if (!confirmExtraction.Value || !Object.op_Implicit((Object)(object)val) || !val.StateIs((State)2)) { ClearClownPlacement(); } return; } if ((Object)(object)clownPlacementAt != (Object)(object)val) { ClearClownPlacement(); clownPlacementAt = val; } if (extractionClown != null) { if (ClownAvailableAt(val)) { return; } bool num = (Object)(object)extractionClown.Point == (Object)(object)val; RemoveExtractionClown(); if (num) { ClownUnavailable(val, "The extraction clown is no longer available."); return; } } if (!((Object)(object)clownFailedAt == (Object)(object)val) && !(Time.unscaledTime < clownRetryAt)) { CreateExtractionClown(val); } } private void CreateExtractionClown(ExtractionPoint point) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; try { if (!Object.op_Implicit((Object)(object)clownPrefab)) { clownPrefab = Resources.Load<GameObject>("valuables/03 medium/valuable manor clown"); if (!Object.op_Implicit((Object)(object)clownPrefab) || !Object.op_Implicit((Object)(object)clownPrefab.GetComponent<ClownTrap>()) || !Object.op_Implicit((Object)(object)clownPrefab.GetComponent<PhysGrabObjectGrabArea>()) || !Object.op_Implicit((Object)(object)clownPrefab.GetComponent<PhotonView>()) || !TryGetClownBounds(clownPrefab, out clownBounds)) { clownPrefab = null; ClownUnavailable(point, "Could not load the base-game extraction clown."); return; } } if (!TryPlaceClown(point, out var position, out var rotation)) { clownRetryAt = Time.unscaledTime + 0.4f; if (++clownPlacementAttempts >= 5) { ClownUnavailable(point, "There is no clear spot to the left of this extraction."); } return; } val = PhotonNetwork.InstantiateRoomObject("valuables/03 medium/valuable manor clown", position, rotation, (byte)0, new object[4] { 0.55f, 0.55f, 0.55f, "demonbytes.repo.noxaraadminmenu.confirm" }); PhotonView val2 = default(PhotonView); ClownTrap val3 = default(ClownTrap); ValuableObject val4 = default(ValuableObject); PhysGrabObject body = default(PhysGrabObject); Rigidbody val5 = default(Rigidbody); PhysGrabObjectGrabArea nose = default(PhysGrabObjectGrabArea); PhysGrabObjectImpactDetector val6 = default(PhysGrabObjectImpactDetector); if (!Object.op_Implicit((Object)(object)val) || !val.TryGetComponent<PhotonView>(ref val2) || !val2.IsMine || !val.TryGetComponent<ClownTrap>(ref val3) || !val.TryGetComponent<ValuableObject>(ref val4) || !val.TryGetComponent<PhysGrabObject>(ref body) || !val.TryGetComponent<Rigidbody>(ref val5) || !val.TryGetComponent<PhysGrabObjectGrabArea>(ref nose) || !val.TryGetComponent<PhysGrabObjectImpactDetector>(ref val6)) { throw new InvalidOperationException("The clown did not spawn with the required base-game components."); } extractionClown = new ExtractionClown { Point = point, Room = room, Object = val, View = val2, Trap = val3, Body = body, Rigidbody = val5, Nose = nose, Anchor = position, AnchorRotation = rotation }; ((Trap)val3).triggerOnTimer = false; val5.constraints = (RigidbodyConstraints)126; val5.excludeLayers = LayerMask.op_Implicit(-1); MaintainExtractionClownPose(); val6.destroyDisable = true; val6.canHurtLogic = false; val4.dollarValueOriginal = 0f; val4.dollarValueCurrent = 0f; val4.dollarValueSet = true; val2.RPC("DollarValueSetRPC", (RpcTarget)4, new object[1] { 0f }); Report("Extraction clown ready. Grab its nose to confirm."); } catch (Exception ex) { if (extractionClown != null) { RemoveExtractionClown(); } else if (Object.op_Implicit((Object)(object)val) && IsHost) { PhotonNetwork.Destroy(val); } ClownUnavailable(point, "Could not create the extraction clown."); ((BaseUnityPlugin)this).Logger.LogError((object)ex); } } private static bool TryGetClownBounds(GameObject prefab, out Bounds bounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) bounds = default(Bounds); bool flag = false; MeshRenderer[] componentsInChildren = prefab.GetComponentsInChildren<MeshRenderer>(true); Vector3 size; Vector3 val3 = default(Vector3); foreach (MeshRenderer val in componentsInChildren) { Bounds localBounds = ((Renderer)val).localBounds; size = ((Bounds)(ref localBounds)).size; if (((Vector3)(ref size)).sqrMagnitude < 0.0001f) { continue; } Matrix4x4 val2 = prefab.transform.worldToLocalMatrix * ((Component)val).transform.localToWorldMatrix; for (int j = 0; j < 8; j++) { ((Vector3)(ref val3))..ctor(((j & 1) == 0) ? ((Bounds)(ref localBounds)).min.x : ((Bounds)(ref localBounds)).max.x, ((j & 2) == 0) ? ((Bounds)(ref localBounds)).min.y : ((Bounds)(ref localBounds)).max.y, ((j & 4) == 0) ? ((Bounds)(ref localBounds)).min.z : ((Bounds)(ref localBounds)).max.z); Vector3 val4 = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(val3); if (!flag) { bounds = new Bounds(val4, Vector3.zero); flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val4); } } } if (flag && ((Bounds)(ref bounds)).size.y > 0.1f) { size = ((Bounds)(ref bounds)).size; return ((Vector3)(ref size)).sqrMagnitude < 30f; } return false; } private bool TryPlaceClown(ExtractionPoint point, out Vector3 position, out Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_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_007d: Unknown result type (might be due to invalid IL or missing references) //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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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) position = default(Vector3); rotation = default(Quaternion); Transform val = ((Component)point).transform.Find("Scale"); if (!Object.op_Implicit((Object)(object)val)) { return false; } Vector3 val2 = val.position + val.rotation * new Vector3(1.9917f, 0f, 1.12559f); rotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(val.forward, Vector3.up)); if (!StationFloor(val2, point, out var y)) { return false; } Vector3 val3 = rotation * Vector3.right * ((Bounds)(ref clownBounds)).extents.x * 0.55f; Vector3 val4 = rotation * Vector3.forward * ((Bounds)(ref clownBounds)).extents.z * 0.55f; for (int i = 0; i < 4; i++) { if (!StationFloor(val2 + (((i & 1) == 0) ? (-val3) : val3) + (((i & 2) == 0) ? (-val4) : val4), point, out var y2) || Mathf.Abs(y2 - y) > 0.08f) { return false; } } Vector3 val5 = rotation * ((Bounds)(ref clownBounds)).center * 0.55f; position = new Vector3(val2.x - val5.x, y - ((Bounds)(ref clownBounds)).min.y * 0.55f, val2.z - val5.z); return true; } private static bool StationFloor(Vector3 pedestal, ExtractionPoint point, out float y) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0017: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) y = float.NegativeInfinity; RaycastHit[] array = Physics.RaycastAll(pedestal + Vector3.up * 0.35f, Vector3.down, 0.75f, -5, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (!(((RaycastHit)(ref val)).normal.y < 0.9f) && !Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).rigidbody) && !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<PhysGrabObject>()) && !((RaycastHit)(ref val)).transform.IsChildOf(point.ramp) && !((RaycastHit)(ref val)).transform.IsChildOf(point.platform) && !((RaycastHit)(ref val)).transform.IsChildOf(point.extractionTube)) { y = Mathf.Max(y, ((RaycastHit)(ref val)).point.y); } } return !float.IsNegativeInfinity(y); } private void FixedUpdate() { MaintainExtractionClownPose(); } private void MaintainExtractionClownPose() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) ExtractionClown extractionClown = this.extractionClown; if (extractionClown != null && IsHost && extractionClown.Room == room && Object.op_Implicit((Object)(object)extractionClown.View) && extractionClown.View.IsMine && Object.op_Implicit((Object)(object)extractionClown.Body) && !extractionClown.Body.dead && Object.op_Implicit((Object)(object)extractionClown.Rigidbody)) { extractionClown.Body.OverrideKinematic(Mathf.Max(0.25f, 3f * Time.fixedDeltaTime)); Rigidbody rigidbody = extractionClown.Rigidbody; Vector3 val = rigidbody.position - extractionClown.Anchor; if (((Vector3)(ref val)).sqrMagnitude > 1E-06f) { rigidbody.position = extractionClown.Anchor; } if (Quaternion.Angle(rigidbody.rotation, extractionClown.AnchorRotation) > 0.1f) { rigidbody.rotation = extractionClown.AnchorRotation; } } } private static void SetConfirmClownContacts(ClownTrap __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) PhotonView component = ((Component)__instance).GetComponent<PhotonView>(); if (Object.op_Implicit((Object)(object)component) && component.IsRoomView) { object[] instantiationData = component.InstantiationData; Rigidbody val = default(Rigidbody); if (instantiationData != null && instantiationData.Length == 4 && object.Equals(instantiationData[3], "demonbytes.repo.noxaraadminmenu.confirm") && ((Component)__instance).TryGetComponent<Rigidbody>(ref val)) { val.excludeLayers = LayerMask.op_Implicit(-1); } } } private static bool IsExtractionClown(Trap trap) { if (Instance?.extractionClown != null) { return (Object)(object)Instance.extractionClown.Trap == (Object)(object)trap; } return false; } private static bool AllowClownTrapStart(Trap __instance) { return !IsExtractionClown(__instance); } private static bool AllowClownExplosion(ClownTrap __instance) { return !IsExtractionClown((Trap)(object)__instance); } private static bool HandleClownNose(ClownTrap __instance) { //IL_00af: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!IsExtractionClown((Trap)(object)__instance)) { return true; } HostMenu instance = Instance; ExtractionClown extractionClown = instance.extractionClown; if (!instance.Ready || !instance.confirmExtraction.Value || !instance.ClownAvailableAt(extractionClown.Point) || Time.unscaledTime < extractionClown.NextPress) { return false; } PlayerAvatar latestGrabber = extractionClown.Nose.GetLatestGrabber(); Player val = ((Object.op_Implicit((Object)(object)latestGrabber) && Object.op_Implicit((Object)(object)latestGrabber.photonView)) ? latestGrabber.photonView.Owner : null); if (val != null && !val.IsInactive && instance.room.GetPlayer(val.ActorNumber, false) == val && !latestGrabber.deadSet && !latestGrabber.isDisabled) { Vector3 val2 = ((Component)latestGrabber).transform.position - extractionClown.Anchor; if (!(((Vector3)(ref val2)).sqrMagnitude > 36f)) { extractionClown.NextPress = Time.unscaledTime + 0.65f; if (instance.PointConfirmState(extractionClown.Point) == ConfirmState.Ready) { instance.FinishExtraction(waiveQuota: false); if (extractionClown.Point.settingState || !extractionClown.Point.StateIs((State)2)) { instance.AddHistory(Clean(val.NickName) + " confirmed the extraction with the clown."); } } else { instance.Report("Extraction quota has not been met."); } return false; } } return false; } private void ClownUnavailable(ExtractionPoint point, string message) { clownFailedAt = point; Report(message + " Automatic extraction is available."); } private void RemoveExtractionClown() { ExtractionClown extractionClown = this.extractionClown; if (extractionClown == null) { return; } if (Object.op_Implicit((Object)(object)extractionClown.Object) && Object.op_Implicit((Object)(object)extractionClown.View) && extractionClown.View.IsMine && PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient && extractionClown.Room == PhotonNetwork.CurrentRoom && (Object)(object)PhotonView.Find(extractionClown.View.ViewID) == (Object)(object)extractionClown.View) { Collider[] componentsInChildren = extractionClown.Object.GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } PhotonNetwork.Destroy(extractionClown.Object); } this.extractionClown = null; } private void ResetExtractionClown() { RemoveExtractionClown(); ClearClownPlacement(); } private void ClearClownPlacement() { clownFailedAt = (clownPlacementAt = null); clownRetryAt = 0f; clownPlacementAttempts = 0; } private static void UpdatePhysicalConfirmButton(ExtractionPoint __instance) { HostMenu instance = Instance; if ((Object)(object)instance == (Object)null || !instance.confirmSupported) { return; } ConfirmState confirmState = instance.PointConfirmState(__instance); if (confirmState == ConfirmState.Hidden) { if ((Object)(object)instance.confirmButton?.Point == (Object)(object)__instance) { instance.RestoreExtractionButton(); } } else { instance.ApplyExtractionButton(__instance, confirmState); } } private ConfirmState PointConfirmState(ExtractionPoint point) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (!available || room == null || room != PhotonNetwork.CurrentRoom || masterActor != room.MasterClientId || !Object.op_Implicit((Object)(object)level) || !level.Generated || (Object)(object)level != (Object)(object)LevelGenerator.Instance || !Object.op_Implicit((Object)(object)point) || point.isShop || !point.StateIs((State)2) || point.settingState || (int)point.stateSetTo != 0 || point.isLocked || !Object.op_Implicit((Object)(object)point.photonView) || !Object.op_Implicit((Object)(object)point.button) || !Object.op_Implicit((Object)(object)point.buttonLight) || !Object.op_Implicit((Object)(object)point.buttonGrabObject) || !Object.op_Implicit((Object)(object)point.buttonOriginalMaterial)) { return ConfirmState.Hidden; } if (!IsHost) { if (point.photonView.ViewID != remoteExtractionPoint || !(Time.unscaledTime < remoteExtractionUntil)) { return ConfirmState.Hidden; } return remoteExtractionState; } if (!Ready || !Object.op_Implicit((Object)(object)RoundDirector.instance) || (Object)(object)RoundDirector.instance.extractionPointCurrent != (Object)(object)point) { return ConfirmState.Hidden; } if (!confirmExtraction.Value || !ClownAvailableAt(point)) { return ConfirmState.Automatic; } if (!point.haulGoalFetched || point.haulCurrent < point.haulGoal) { return ConfirmState.WaitingForQuota; } return ConfirmState.Ready; } private void ApplyExtractionButton(ExtractionPoint point, ConfirmState mode) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_013b: 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) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) if (confirmButton == null || (Object)(object)confirmButton.Point != (Object)(object)point) { RestoreExtractionButton(); confirmButton = new ExtractionButtonState { Point = point, Grab = point.buttonGrabObject, Renderer = point.button, Light = point.buttonLight, PreviousMaterial = ((Renderer)point.button).sharedMaterial, PreviousGrabEnabled = ((Behaviour)point.buttonGrabObject).enabled, PreviousLightEnabled = ((Behaviour)point.buttonLight).enabled, PreviousColor = point.buttonLight.color, PreviousHover = point.buttonGrabObject.hoverText }; } ExtractionButtonState extractionButtonState = confirmButton; extractionButtonState.OurGrabEnabled = mode == ConfirmState.Ready; extractionButtonState.OurLightEnabled = mode != ConfirmState.Automatic; ExtractionButtonState extractionButtonState2 = extractionButtonState; extractionButtonState2.OurMaterial = (Material)(mode switch { ConfirmState.Ready => point.buttonOriginalMaterial, ConfirmState.WaitingForQuota => Object.op_Implicit((Object)(object)point.buttonDenyMaterial) ? point.buttonDenyMaterial : point.buttonOff, _ => point.buttonOff, }); extractionButtonState.OurColor = ((mode == ConfirmState.Ready) ? new Color(0.2f, 1f, 0.35f) : new Color(1f, 0.18f, 0.12f)); extractionButtonState2 = extractionButtonState; extractionButtonState2.OurHover = mode switch { ConfirmState.Ready => "Confirm extraction", ConfirmState.WaitingForQuota => "Extraction quota not met", _ => "Automatic extraction", }; if (Object.op_Implicit((Object)(object)extractionButtonState.OurMaterial) && (Object)(object)((Renderer)extractionButtonState.Renderer).sharedMaterial != (Object)(object)extractionButtonState.OurMaterial) { ((Renderer)extractionButtonState.Renderer).sharedMaterial = extractionButtonState.OurMaterial; } if (extractionButtonState.Light.color != extractionButtonState.OurColor) { extractionButtonState.Light.color = extractionButtonState.OurColor; } if (((Behaviour)extractionButtonState.Light).enabled != extractionButtonState.OurLightEnabled) { ((Behaviour)extractionButtonState.Light).enabled = extractionButtonState.OurLightEnabled; } if (((Behaviour)extractionButtonState.Grab).enabled != extractionButtonState.OurGrabEnabled) { ((Behaviour)extractionButtonState.Grab).enabled = extractionButtonState.OurGrabEnabled; } if (extractionButtonState.Grab.hoverText != extractionButtonState.OurHover) { extractionButtonState.Grab.hoverText = extractionButtonState.OurHover; } } private static void ConfirmFromGrab(StaticGrabObject __instance, int playerPhotonID, PhotonMessageInfo _info) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00ed: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) HostMenu instance = Instance; if ((Object)(object)instance == (Object)null || !instance.Ready) { return; } ExtractionButtonState extractionButtonState = instance.confirmButton; if (extractionButtonState == null || (Object)(object)extractionButtonState.Grab != (Object)(object)__instance || instance.PointConfirmState(extractionButtonState.Point) != ConfirmState.Ready) { return; } PhotonView val = PhotonView.Find(playerPhotonID); Player sender = _info.Sender; PhysGrabber val2 = default(PhysGrabber); if (Object.op_Implicit((Object)(object)val) && sender != null && !sender.IsInactive && val.Owner == sender && instance.room.GetPlayer(sender.ActorNumber, false) == sender && SameMod(sender) && ((Component)val).TryGetComponent<PhysGrabber>(ref val2) && extractionButtonState.Grab.playerGrabbing.Contains(val2) && Object.op_Implicit((Object)(object)val2.playerAvatar) && !val2.playerAvatar.deadSet && !val2.playerAvatar.isDisabled) { Vector3 position = ((Component)extractionButtonState.Renderer).transform.position; Vector3 val3 = ((Component)val2.playerAvatar).transform.position - position; if (!(((Vector3)(ref val3)).sqrMagnitude > 36f)) { instance.FinishExtraction(waiveQuota: false); instance.AddHistory(Clean(sender.NickName) + " confirmed the extraction."); } } } private void SyncExtractionState() { //IL_00f3: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown if (!IsHost || !confirmSupported) { return; } ExtractionPoint val = (Object.op_Implicit((Object)(object)RoundDirector.instance) ? RoundDirector.instance.extractionPointCurrent : null); ConfirmState confirmState = PointConfirmState(val); int num = ((confirmState != ConfirmState.Hidden) ? val.photonView.ViewID : 0); float unscaledTime = Time.unscaledTime; if (sentExtractionPoint != num || sentExtractionState != confirmState || (confirmState != ConfirmState.Hidden && !(unscaledTime < nextExtractionSync))) { int[] array = (from p in room.Players.Values where p != null && !p.IsLocal && !p.IsInactive && SameMod(p) select p.ActorNumber).ToArray(); if (array.Length != 0) { PhotonNetwork.RaiseEvent((byte)175, (object)new object[3] { "demonbytes.repo.noxaraadminmenu", num, (int)confirmState }, new RaiseEventOptions { TargetActors = array }, SendOptions.SendReliable); } sentExtractionPoint = num; sentExtractionState = confirmState; nextExtractionSync = unscaledTime + 1.5f; } } private void ReceiveExtractionState(EventData data) { if (data.Code != 175 || room == null || room != PhotonNetwork.CurrentRoom || IsHost || data.Sender != masterActor || room.MasterClientId != masterActor) { return; } Player player = room.GetPlayer(masterActor, false); if (player != null && SameMod(player) && data.CustomData is object[] array && array.Length == 3 && object.Equals(array[0], "demonbytes.repo.noxaraadminmenu") && array[1] is int num && array[2] is int num2) { bool num3; switch (num2) { case 1: case 2: case 3: num3 = num <= 0; break; case 0: num3 = num != 0; break; default: return; } if (!num3) { remoteExtractionPoint = num; remoteExtractionState = (ConfirmState)num2; remoteExtractionUntil = Time.unscaledTime + 5f; } } } private void ResetExtractionState() { RestoreExtractionButton(); remoteExtractionPoint = (sentExtractionPoint = 0); remoteExtractionState = (sentExtractionState = ConfirmState.Hidden); nextExtractionSync = (remoteExtractionUntil = 0f); } private void RestoreExtractionButton() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) ExtractionButtonState extractionButtonState = confirmButton; if (extractionButtonState == null) { return; } confirmButton = null; if (Object.op_Implicit((Object)(object)extractionButtonState.Grab) && extractionButtonState.Grab.hoverText == extractionButtonState.OurHover) { extractionButtonState.Grab.hoverText = extractionButtonState.PreviousHover; if (((Behaviour)extractionButtonState.Grab).enabled == extractionButtonState.OurGrabEnabled) { ((Behaviour)extractionButtonState.Grab).enabled = extractionButtonState.PreviousGrabEnabled; } } if (Object.op_Implicit((Object)(object)extractionButtonState.Renderer) && (Object)(object)((Renderer)extractionButtonState.Renderer).sharedMaterial == (Object)(object)extractionButtonState.OurMaterial) { ((Renderer)extractionButtonState.Renderer).sharedMaterial = extractionButtonState.PreviousMaterial; } if (Object.op_Implicit((Object)(object)extractionButtonState.Light)) { if (extractionButtonState.Light.color == extractionButtonState.OurColor) { extractionButtonState.Light.color = extractionButtonState.PreviousColor; } if (((Behaviour)extractionButtonState.Light).enabled == extractionButtonState.OurLightEnabled) { ((Behaviour)extractionButtonState.Light).enabled = extractionButtonState.PreviousLightEnabled; } } } private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown Instance = this; hotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Menu", "Hotkey", new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()), (ConfigDescription)null); showHud = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Team status", true, (ConfigDescription)null); showAlerts = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Join notifications", true, (ConfigDescription)null); joinNoticeSeconds = ((BaseUnityPlugin)this).Config.Bind<int>("HUD", "Join notification seconds", 5, Range(1, 30)); menuOpacity = ((BaseUnityPlugin)this).Config.Bind<int>("Appearance", "Menu opacity percent", 98, Range(20, 100)); hudOpacity = ((BaseUnityPlugin)this).Config.Bind<int>("Appearance", "HUD opacity percent", 92, Range(20, 100)); maximumUpgrade = ((BaseUnityPlugin)this).Config.Bind<int>("Upgrades", "Editor maximum", 100, Range(1, 1000)); ConfigDescription val = new ConfigDescription("Position relative to the usable screen area.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()); hudPositionX = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Position X", 1f, val); hudPositionY = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Position Y", 0.2f, val); banPath = Path.Combine(Paths.ConfigPath, "demonbytes.repo.noxaraadminmenu.bans.tsv"); ReadBans(); PatchFeature(typeof(CursorManager), "Unlock", "KeepOverlayCursorUnlocked"); PatchFeature(typeof(MenuCursor), "Show", "AllowNativeMenuCursor"); } private void Start() { conflict = (from p in Chainloader.PluginInfos.Values select p.Metadata into p where p.GUID != "demonbytes.repo.noxaraadminmenu" && IsConflictingPlugin(p.GUID, p.Name) select p.Name).FirstOrDefault(); if (conflict != null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Admin menu disabled. This profile already loads " + conflict + ".")); return; } available = true; RegisterProtectionPatches(); RegisterLateJoinPatches(); RegisterOptions(); PatchFeature(typeof(ValuableDirector), "SpawnValuable", "MarkLootVolume", postfix: true); PhotonNetwork.NetworkingClient.EventReceived += ReceiveProtection; PhotonNetwork.NetworkingClient.EventReceived += ReceiveExtractionState; ((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("NoxaraAdminMenu by Demonbytes {0}, game {1}, Late Join: {2}", "1.0.1", typeof(LevelGenerator).Assembly.ManifestModule.ModuleVersionId, joinSupported)); } private static bool IsConflictingPlugin(string id, string name) { string text = (id + name).Replace(" ", "").Replace("_", "").ToLowerInvariant(); if (!text.Contains("latejoin") && !text.Contains("repoadminmenu") && !text.Contains("demonbytesmod") && !text.Contains("teamstatus") && !text.Contains("moreplayers")) { return text.Contains("robounion"); } return true; } private void OnDestroy() { ReleaseOverlayCursor(); RestoreExtractionButton(); ResetExtractionClown(); ClearPreviews(); if (Object.op_Implicit((Object)(object)brand)) { Object.Destroy((Object)(object)brand); } ClearOwnedEnemyIgnores(); if (available) { PhotonNetwork.NetworkingClient.EventReceived -= ReceiveProtection; PhotonNetwork.NetworkingClient.EventReceived -= ReceiveExtractionState; } joinPatches.UnpatchSelf(); patches.UnpatchSelf(); Instance = null; } private void Update() { //IL_000e: 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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_011c: Expected O, but got Unknown KeyboardShortcut value; if (!available) { value = hotkey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { open = !open; } if (open && Input.GetKeyDown((KeyCode)27)) { open = false; } UpdateOverlayCursor(); return; } Room currentRoom = PhotonNetwork.CurrentRoom; if (room != currentRoom || masterActor != ((currentRoom != null) ? currentRoom.MasterClientId : 0)) { room = currentRoom; masterActor = ((currentRoom != null) ? currentRoom.MasterClientId : 0); members.Clear(); history.Clear(); ResetProtection(); ResetLateJoin(); ResetModuleScene(); ResetTeamCredits(); manualLobby = (forceClosed = (lateJoin = (open = false))); pending = (confirmation = null); selectedActor = 0; if (room != null) { Player localPlayer = PhotonNetwork.LocalPlayer; Hashtable val = new Hashtable(); ((Dictionary<object, object>)val).Add((object)"demonbytes.noxaraadminmenu", (object)"1.0.1"); localPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } PollMembers(initial: true); } if ((Object)(object)level != (Object)(object)LevelGenerator.Instance) { level = LevelGenerator.Instance; sceneTransition = false; ResetSpawnCatalog(); ResetModuleScene(); pending = (confirmation = null); haulRound = null; usedLootVolumes.RemoveWhere((ValuableVolume v) => !Object.op_Implicit((Object)(object)v)); if (IsHost) { CancelObsoleteJoins(); } } if (!IsHost) { open = false; ReleaseOverlayCursor(); return; } if (Time.unscaledTime >= pollAt) { pollAt = Time.unscaledTime + 0.25f; try { PollMembers(); PollRoundHaul(); TickLateJoin(); TickLobbyAdmission(); RefreshProtectionGrants(); UpdateEnemyIgnoreList(); TickExtractionClown(); SyncExtractionState(); TickOptions(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)ex); pollAt = Time.unscaledTime + 2f; if (lateJoin) { lateJoin = false; manualLobby = (forceClosed = true); SetJoinability(accept: false); AddHistory("Late Join locked after a runtime error. See the BepInEx log."); } } } value = hotkey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { open = !open; } if (open && Input.GetKeyDown((KeyCode)27)) { open = false; } UpdateOverlayCursor(); if (open) { CaptureInput(); } else { confirmation = null; } Action action = pending; pending = null; if (action == null) { return; } try { action(); } catch (Exception ex2) { Report("Action failed. See the BepInEx log."); ((BaseUnityPlugin)this).Logger.LogError((object)ex2); } } private void CaptureInput() { if (Object.op_Implicit((Object)(object)InputManager.instance)) { InputManager.instance.DisableControlsExcept(0.12f, allowedInputs); InputManager.instance.DisableAiming(0.12f); InputManager.instance.DisableMovement(0.12f); } if (Object.op_Implicit((Object)(object)PlayerController.instance)) { PlayerController.instance.InputDisable(0.12f); } } private void Queue(Action action, bool world = true) { if (!IsHost || pending != null) { return; } Room origin = room; LevelGenerator scene = level; pending = delegate { if (!IsHost || room != origin || (world && (!Ready || (Object)(object)scene != (Object)(object)level))) { Report("Action cancelled because the lobby or level changed."); } else { action(); } }; } private void PollMembers(bool initial = false) { if (!IsHost) { return; } Dictionary<int, Player> connected = PhotonNetwork.PlayerList.Where((P