using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.EventSystems; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("Zichen-GameTools-1.0.9")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+1edd851a2e3ea048362167ab33bf7a71fd12cfc3")] [assembly: AssemblyProduct("Zichen-GameTools-1.0.9")] [assembly: AssemblyTitle("Zichen-GameTools-1.0.9")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Zichen_GameTools { public enum DisplayLanguage { 中文, English } [BepInPlugin("zichen.gametools", "GameTools", "1.0.9")] public class Plugin : BaseUnityPlugin { internal class BatteryCache { public bool Resolved; public itemType ItemType; public bool FallbackResult; } internal sealed class CfgI18N { public string SectionCN; public string SectionEN; public string KeyCN; public string KeyEN; public string DisplayEN; public string DescCN; public string DescEN; public ConfigurationManagerAttributes Attrs; public string ValueEN; public string ValueCN; public ConfigEntry ReadOnlyEntry; public ConfigEntryBase Entry; } public enum SpawnType { Valuable, Weapon, Enemy, Cart, Vehicle, Other } public class SpawnableInfo { public string Name; public string InternalName; public SpawnType Type; public object Source; public string ExtraInfo; private string _cachedNameCN; private string _cachedNameEN; public string GetDisplayName() { if (UseChinese()) { if (_cachedNameCN == null) { string name = Name; name = ((Type != SpawnType.Enemy) ? ItemNameLocalizer.Translate(Name) : EnemyNameLocalizer.Translate(Name)); if (!string.IsNullOrEmpty(ExtraInfo)) { _cachedNameCN = name + " " + ExtraInfo; } else { _cachedNameCN = name; } } return _cachedNameCN; } if (_cachedNameEN == null) { string name2 = Name; if (!string.IsNullOrEmpty(ExtraInfo)) { _cachedNameEN = name2 + " " + ExtraInfo; } else { _cachedNameEN = name2; } } return _cachedNameEN; } } internal enum PlayerTeleportType { PullToFront, Scatter, ToTruck, ToExtractionButton } [HarmonyPatch(typeof(InputManager), "InitializeInputs")] private class InputManager_InitializeInputs_Patch { [HarmonyPostfix] private static void Postfix() { try { InputManagerInitializeInputsPostfix(); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[InitializeInputs Patch Error]: {arg}"); } } } } [HarmonyPatch(typeof(PlayerController), "Start")] private class PlayerController_Start_Patch { [HarmonyPostfix] private static void Postfix() { try { PlayerControllerStartPostfix(); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerController.Start Patch Error]: {arg}"); } } } } [HarmonyPatch(typeof(CameraAim), "Update")] private class CameraAim_Update_Patch { private static readonly FieldRef _fOverridePlayerAimDisableTimer = AccessTools.FieldRefAccess("overridePlayerAimDisableTimer"); private static readonly FieldRef _fOverrideAimStopTimer = AccessTools.FieldRefAccess("overrideAimStopTimer"); private static readonly FieldRef _fOverrideAimStop = AccessTools.FieldRefAccess("overrideAimStop"); private static readonly FieldRef _fDisableAimingTimer = AccessTools.FieldRefAccess("disableAimingTimer"); private static readonly FieldRef _fAimInvertVertical = AccessTools.FieldRefAccess("aimInvertVertical"); private static readonly FieldRef _fAimHorizontal = AccessTools.FieldRefAccess("aimHorizontal"); private static readonly FieldRef _fAimVertical = AccessTools.FieldRefAccess("aimVertical"); [HarmonyPrefix] private static void Prefix(CameraAim __instance) { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if (!IsStaticModEnabled() || !IsTumbleFlyEnabled()) { return; } try { PlayerController instance = PlayerController.instance; PlayerTumble val = (((Object)(object)instance != (Object)null && (Object)(object)instance.playerAvatarScript != (Object)null) ? PlayerAvatarTumbleRef.Invoke(instance.playerAvatarScript) : null); if (!((Object)(object)val != (Object)null) || !PlayerTumbleIsTumblingRef.Invoke(val)) { return; } Keyboard current = Keyboard.current; if (current == null || !((ButtonControl)current.qKey).isPressed) { return; } _fOverridePlayerAimDisableTimer.Invoke(__instance) = 0f; _fOverrideAimStopTimer.Invoke(__instance) = 0f; _fOverrideAimStop.Invoke(__instance) = false; if ((Object)(object)InputManager.instance != (Object)null) { _fDisableAimingTimer.Invoke(InputManager.instance) = 0f; } float num = SemiFunc.InputMouseX(); float num2 = SemiFunc.InputMouseY(); if (!(Mathf.Abs(num) < 0.0001f) || !(Mathf.Abs(num2) < 0.0001f)) { return; } Mouse current2 = Mouse.current; if (current2 == null) { return; } Vector2 val2 = ((InputControl)(object)((Pointer)current2).delta).ReadValue(); if (((Vector2)(ref val2)).sqrMagnitude > 0.0001f) { float aimSpeedMouse = __instance.AimSpeedMouse; float num3 = val2.x * 0.05f * aimSpeedMouse; float num4 = val2.y * 0.05f * aimSpeedMouse; if ((Object)(object)GameplayManager.instance != (Object)null && _fAimInvertVertical.Invoke(GameplayManager.instance)) { num4 *= -1f; } ref float reference = ref _fAimHorizontal.Invoke(__instance); ref float reference2 = ref _fAimVertical.Invoke(__instance); reference += num3; if (reference > 360f) { reference -= 360f; } if (reference < -360f) { reference += 360f; } reference2 -= num4; reference2 = Mathf.Clamp(reference2, -70f, 80f); } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[CameraAim.Update Prefix Error]: {arg}"); } } } } [HarmonyPatch(typeof(PlayerAvatar), "ReviveRPC")] private class PlayerAvatar_ReviveRPC_Patch { [HarmonyPostfix] private static void Postfix(PlayerAvatar __instance) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0041: 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) if (!IsStaticModEnabled() || !IsTeammateReviveDropBeadEnabled() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { GameObject enemyValuableSmall = AssetManager.instance.enemyValuableSmall; if ((Object)(object)enemyValuableSmall != (Object)null) { Vector3 position = ((Component)__instance).transform.position; if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(enemyValuableSmall, position, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)enemyValuableSmall).name, position, Quaternion.identity, (byte)0, (object[])null); } LogInfo($"[GameTools] Player {((Object)__instance).name} revived. Dropped a small valuable shard at {position}."); } } catch (Exception arg) { LogWarning($"[TeammateReviveDropBead Error]: {arg}"); } } } [HarmonyPatch(typeof(PlayerAvatar), "UpgradeTumbleWingsVisualsActive")] private class PlayerAvatar_UpgradeTumbleWingsVisualsActive_Patch { [HarmonyPrefix] private static bool Prefix(PlayerAvatar __instance, ref bool _visualsActive) { if (!IsStaticModEnabled()) { return true; } try { if (IsWingsAlwaysShowEnabled() && PlayerAvatarIsLocalRef.Invoke(__instance) && !_visualsActive) { _visualsActive = true; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[UpgradeTumbleWingsVisualsActive.Prefix Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(PlayerAvatar), "UpgradeTumbleWingsVisualsActiveRPC")] private class PlayerAvatar_UpgradeTumbleWingsVisualsActiveRPC_Patch { [HarmonyPrefix] private static void Prefix(PlayerAvatar __instance, ref bool _visualsActive) { if (!IsStaticModEnabled()) { return; } try { object value; if (IsWingsAlwaysShowEnabled() && PlayerAvatarIsLocalRef.Invoke(__instance)) { _visualsActive = true; } else if (!PlayerAvatarIsLocalRef.Invoke(__instance) && !_visualsActive && PhotonNetwork.InRoom && (Object)(object)__instance.photonView != (Object)null && __instance.photonView.Owner != null && ((Dictionary)(object)__instance.photonView.Owner.CustomProperties).TryGetValue((object)"GT_WingsAlwaysShow", out value) && value is bool && (bool)value) { _visualsActive = true; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[UpgradeTumbleWingsVisualsActiveRPC.Prefix Error]: {arg}"); } } } } [HarmonyPatch(typeof(PlayerAvatar), "Update")] private class PlayerAvatar_Update_Patch { private static float _lastMultiCheckTime = 0f; private static bool _lastSentFlip = false; private static bool _lastSentSpinEnabled = false; private static int _lastSentSpinDirection = 0; private static int _lastSentSpinAxis = 0; private static float _lastSentSpinSpeed = -1f; private static bool _hasInitializedSentStates = false; private static readonly ConditionalWeakTable _wingsLogicCache = new ConditionalWeakTable(); private static readonly FieldRef f_eyeMaterial = AccessTools.FieldRefAccess("eyeMaterial"); private static readonly FieldRef f_pupilMaterial = AccessTools.FieldRefAccess("pupilMaterial"); private static ItemUpgradePlayerTumbleWingsLogic GetWingsLogic(PlayerAvatar avatar) { if ((Object)(object)avatar == (Object)null) { return null; } if (!_wingsLogicCache.TryGetValue(avatar, out var value)) { value = ((Component)avatar).GetComponentInChildren(true); _wingsLogicCache.Add(avatar, value); } return value; } [HarmonyPostfix] private static void Postfix(PlayerAvatar __instance) { //IL_1c49: Unknown result type (might be due to invalid IL or missing references) //IL_1c50: Expected O, but got Unknown //IL_12d3: Unknown result type (might be due to invalid IL or missing references) //IL_12da: Expected O, but got Unknown //IL_183c: Unknown result type (might be due to invalid IL or missing references) //IL_1843: Expected O, but got Unknown //IL_16e4: Unknown result type (might be due to invalid IL or missing references) //IL_16e9: Unknown result type (might be due to invalid IL or missing references) //IL_16eb: Unknown result type (might be due to invalid IL or missing references) //IL_16f0: Unknown result type (might be due to invalid IL or missing references) //IL_1713: Unknown result type (might be due to invalid IL or missing references) //IL_1715: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Expected O, but got Unknown //IL_1660: Unknown result type (might be due to invalid IL or missing references) //IL_1e56: Unknown result type (might be due to invalid IL or missing references) //IL_1e5e: Unknown result type (might be due to invalid IL or missing references) //IL_16b9: Unknown result type (might be due to invalid IL or missing references) //IL_17c9: Unknown result type (might be due to invalid IL or missing references) //IL_17a6: Unknown result type (might be due to invalid IL or missing references) //IL_17a8: Unknown result type (might be due to invalid IL or missing references) //IL_1765: Unknown result type (might be due to invalid IL or missing references) //IL_1767: Unknown result type (might be due to invalid IL or missing references) //IL_192c: Unknown result type (might be due to invalid IL or missing references) //IL_1931: Unknown result type (might be due to invalid IL or missing references) //IL_17e5: Unknown result type (might be due to invalid IL or missing references) //IL_19a3: Unknown result type (might be due to invalid IL or missing references) //IL_19a8: Unknown result type (might be due to invalid IL or missing references) if ((_cfgModEnabled == null || !_cfgModEnabled.Value) && !IsCosmeticsEnabled()) { return; } if (PlayerAvatarIsLocalRef.Invoke(__instance)) { UpdateLocalEyeTimer(); } try { string text = PlayerAvatarSteamIDRef.Invoke(__instance); int value = 0; if ((Object)(object)StatsManager.instance != (Object)null && !string.IsNullOrEmpty(text)) { StatsManager.instance.playerUpgradeTumbleWings.TryGetValue(text, out value); } if (PlayerAvatarIsLocalRef.Invoke(__instance)) { bool flag = IsWingsAlwaysShowEnabled(); if (flag) { int wingsColorIndex = GetWingsColorIndex(); float num = ((wingsColorIndex == 1) ? 2f : 3f); int num2 = ((wingsColorIndex == 1) ? 2 : 3); if (PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) != num) { PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) = num; } bool flag2 = true; int num3 = 0; if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_WingsColorIndex", out object value2)) { num3 = SafeConvertToInt(value2); } bool flag3 = num3 != wingsColorIndex; if (PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) != flag2 || flag3) { __instance.UpgradeTumbleWingsVisualsActive(flag2, wingsColorIndex == 1); PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) = flag2; } ItemUpgradePlayerTumbleWingsLogic wingsLogic = GetWingsLogic(__instance); if ((Object)(object)wingsLogic != (Object)null && flag2) { if (TumbleWingTimerRef.Invoke(wingsLogic) < 1.15f) { TumbleWingTimerRef.Invoke(wingsLogic) = 1.15f; } switch (wingsColorIndex) { case 1: TumbleWingPinkTimerRef.Invoke(wingsLogic) = Mathf.Max(TumbleWingPinkTimerRef.Invoke(wingsLogic), 1.15f); if (!WingsIsPinkRef.Invoke(wingsLogic)) { WingsIsPinkRef.Invoke(wingsLogic) = true; wingsLogic.WingsSetPinkColors(); } break; case 2: if (WingsIsPinkRef.Invoke(wingsLogic) || TumbleWingPinkTimerRef.Invoke(wingsLogic) != 0f) { TumbleWingPinkTimerRef.Invoke(wingsLogic) = 0f; WingsIsPinkRef.Invoke(wingsLogic) = false; wingsLogic.WingsSetOriginalColors(); } break; case 3: { float num4 = 5f; float wingsShowFrequency = GetWingsShowFrequency(); if (wingsShowFrequency > 0.01f) { num4 = 1f / wingsShowFrequency; } if ((int)(Time.time * num4) % 2 == 0) { TumbleWingPinkTimerRef.Invoke(wingsLogic) = Mathf.Max(TumbleWingPinkTimerRef.Invoke(wingsLogic), 1.15f); if (!WingsIsPinkRef.Invoke(wingsLogic)) { WingsIsPinkRef.Invoke(wingsLogic) = true; wingsLogic.WingsSetPinkColors(); } } else if (WingsIsPinkRef.Invoke(wingsLogic) || TumbleWingPinkTimerRef.Invoke(wingsLogic) != 0f) { TumbleWingPinkTimerRef.Invoke(wingsLogic) = 0f; WingsIsPinkRef.Invoke(wingsLogic) = false; wingsLogic.WingsSetOriginalColors(); } break; } } } if (PhotonNetwork.IsMasterClient && (Object)(object)StatsManager.instance != (Object)null && !string.IsNullOrEmpty(text)) { int value3 = 0; StatsManager.instance.playerUpgradeTumbleWings.TryGetValue(text, out value3); if (value3 != num2) { if (!_originalWingsLevel.ContainsKey(text)) { _originalWingsLevel[text] = value3; } StatsManager.instance.playerUpgradeTumbleWings[text] = num2; SemiFunc.StatSyncAll(); } } } else { if (PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) > (float)value) { PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) = value; if (value <= 0) { __instance.UpgradeTumbleWingsVisualsActive(false, false); PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) = false; } } ItemUpgradePlayerTumbleWingsLogic wingsLogic2 = GetWingsLogic(__instance); if ((Object)(object)wingsLogic2 != (Object)null && (WingsIsPinkRef.Invoke(wingsLogic2) || TumbleWingPinkTimerRef.Invoke(wingsLogic2) != 0f)) { TumbleWingPinkTimerRef.Invoke(wingsLogic2) = 0f; WingsIsPinkRef.Invoke(wingsLogic2) = false; wingsLogic2.WingsSetOriginalColors(); } if (PhotonNetwork.IsMasterClient && (Object)(object)StatsManager.instance != (Object)null && !string.IsNullOrEmpty(text) && _originalWingsLevel.TryGetValue(text, out var value4)) { StatsManager.instance.playerUpgradeTumbleWings[text] = value4; _originalWingsLevel.Remove(text); SemiFunc.StatSyncAll(); } } if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val = new Hashtable(); bool flag4 = false; bool flag5 = false; if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_WingsAlwaysShow", out object value5) && value5 is bool) { flag5 = (bool)value5; } if (flag5 != flag) { val[(object)"GT_WingsAlwaysShow"] = flag; flag4 = true; } int num5 = 0; if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_WingsColorIndex", out object value6)) { num5 = SafeConvertToInt(value6); } int wingsColorIndex2 = GetWingsColorIndex(); if (num5 != wingsColorIndex2) { val[(object)"GT_WingsColorIndex"] = wingsColorIndex2; flag4 = true; } if (!_hasInitializedSentStates) { _hasInitializedSentStates = true; if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_Flip", out object value7) && value7 is bool) { _lastSentFlip = (bool)value7; } if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_SpinEnabled", out object value8) && value8 is bool) { _lastSentSpinEnabled = (bool)value8; } if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_SpinDirection", out object value9)) { _lastSentSpinDirection = SafeConvertToInt(value9); } if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_SpinAxis", out object value10)) { _lastSentSpinAxis = SafeConvertToInt(value10); } if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_SpinSpeed", out object value11)) { _lastSentSpinSpeed = SafeConvertToFloat(value11, 1f); } } bool flag6 = IsFlipEnabled(); if (_lastSentFlip != flag6) { val[(object)"GT_Flip"] = flag6; _lastSentFlip = flag6; flag4 = true; } bool flag7 = IsSpinEnabled(); if (_lastSentSpinEnabled != flag7) { val[(object)"GT_SpinEnabled"] = flag7; _lastSentSpinEnabled = flag7; flag4 = true; } int num6 = ((_cfgSpinDirection == null) ? 1 : _cfgSpinDirection.Value); if (_lastSentSpinDirection != num6) { val[(object)"GT_SpinDirection"] = num6; _lastSentSpinDirection = num6; flag4 = true; } int num7 = ((_cfgSpinAxis == null) ? 1 : _cfgSpinAxis.Value); if (_lastSentSpinAxis != num7) { val[(object)"GT_SpinAxis"] = num7; _lastSentSpinAxis = num7; flag4 = true; } float spinSpeed = GetSpinSpeed(); if (Mathf.Abs(_lastSentSpinSpeed - spinSpeed) > 0.01f) { val[(object)"GT_SpinSpeed"] = spinSpeed; _lastSentSpinSpeed = spinSpeed; flag4 = true; } if (flag4) { PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } } else { bool flag8 = false; int num8 = 0; if (PhotonNetwork.InRoom && (Object)(object)__instance.photonView != (Object)null && __instance.photonView.Owner != null) { Player owner = __instance.photonView.Owner; if (((Dictionary)(object)owner.CustomProperties).TryGetValue((object)"GT_WingsAlwaysShow", out object value12) && value12 is bool) { flag8 = (bool)value12; } if (((Dictionary)(object)owner.CustomProperties).TryGetValue((object)"GT_WingsColorIndex", out object value13)) { num8 = SafeConvertToInt(value13); } } else { flag8 = false; num8 = 0; } if (flag8 && _cfgModEnabled != null && _cfgModEnabled.Value) { float num9 = ((num8 == 1) ? 2f : 3f); int num10 = ((num8 == 1) ? 2 : 3); if (PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) != num9) { PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) = num9; } bool flag9 = true; if (PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) != flag9) { __instance.UpgradeTumbleWingsVisualsActive(flag9, num8 == 1); PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) = flag9; } ItemUpgradePlayerTumbleWingsLogic wingsLogic3 = GetWingsLogic(__instance); if ((Object)(object)wingsLogic3 != (Object)null && flag9) { if (TumbleWingTimerRef.Invoke(wingsLogic3) < 1.15f) { TumbleWingTimerRef.Invoke(wingsLogic3) = 1.15f; } switch (num8) { case 1: TumbleWingPinkTimerRef.Invoke(wingsLogic3) = Mathf.Max(TumbleWingPinkTimerRef.Invoke(wingsLogic3), 1.15f); if (!WingsIsPinkRef.Invoke(wingsLogic3)) { WingsIsPinkRef.Invoke(wingsLogic3) = true; wingsLogic3.WingsSetPinkColors(); } break; case 2: if (WingsIsPinkRef.Invoke(wingsLogic3) || TumbleWingPinkTimerRef.Invoke(wingsLogic3) != 0f) { TumbleWingPinkTimerRef.Invoke(wingsLogic3) = 0f; WingsIsPinkRef.Invoke(wingsLogic3) = false; wingsLogic3.WingsSetOriginalColors(); } break; case 3: { float num11 = 5f; float wingsShowFrequency2 = GetWingsShowFrequency(); if (wingsShowFrequency2 > 0.01f) { num11 = 1f / wingsShowFrequency2; } if ((int)(Time.time * num11) % 2 == 0) { TumbleWingPinkTimerRef.Invoke(wingsLogic3) = Mathf.Max(TumbleWingPinkTimerRef.Invoke(wingsLogic3), 1.15f); if (!WingsIsPinkRef.Invoke(wingsLogic3)) { WingsIsPinkRef.Invoke(wingsLogic3) = true; wingsLogic3.WingsSetPinkColors(); } } else if (WingsIsPinkRef.Invoke(wingsLogic3) || TumbleWingPinkTimerRef.Invoke(wingsLogic3) != 0f) { TumbleWingPinkTimerRef.Invoke(wingsLogic3) = 0f; WingsIsPinkRef.Invoke(wingsLogic3) = false; wingsLogic3.WingsSetOriginalColors(); } break; } } } if (PhotonNetwork.IsMasterClient && (Object)(object)StatsManager.instance != (Object)null && !string.IsNullOrEmpty(text)) { int value14 = 0; StatsManager.instance.playerUpgradeTumbleWings.TryGetValue(text, out value14); if (value14 != num10) { if (!_originalWingsLevel.ContainsKey(text)) { _originalWingsLevel[text] = value14; } StatsManager.instance.playerUpgradeTumbleWings[text] = num10; SemiFunc.StatSyncAll(); } } } else { if (PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) > (float)value) { PlayerAvatarUpgradeTumbleWingsRef.Invoke(__instance) = value; if (value <= 0) { PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance) = false; } } ItemUpgradePlayerTumbleWingsLogic wingsLogic4 = GetWingsLogic(__instance); if ((Object)(object)wingsLogic4 != (Object)null && (WingsIsPinkRef.Invoke(wingsLogic4) || TumbleWingPinkTimerRef.Invoke(wingsLogic4) != 0f)) { TumbleWingPinkTimerRef.Invoke(wingsLogic4) = 0f; WingsIsPinkRef.Invoke(wingsLogic4) = false; wingsLogic4.WingsSetOriginalColors(); } if (PhotonNetwork.IsMasterClient && (Object)(object)StatsManager.instance != (Object)null && !string.IsNullOrEmpty(text) && _originalWingsLevel.TryGetValue(text, out var value15)) { StatsManager.instance.playerUpgradeTumbleWings[text] = value15; _originalWingsLevel.Remove(text); SemiFunc.StatSyncAll(); } } } if (PhotonNetwork.InRoom && Time.time - _lastMultiCheckTime >= 0.1f) { _lastMultiCheckTime = Time.time; string text2 = PlayerAvatarSteamIDRef.Invoke(__instance); string text3 = (((Object)(object)__instance.photonView != (Object)null && __instance.photonView.Owner != null) ? __instance.photonView.Owner.ActorNumber.ToString() : ""); bool flag10 = PlayerAvatarDeadSetRef.Invoke(__instance); if (PlayerAvatarIsLocalRef.Invoke(__instance)) { string text4 = ((PhotonNetwork.LocalPlayer != null) ? PhotonNetwork.LocalPlayer.ActorNumber.ToString() : ""); if (flag10) { string key = "GT_ReqRevive_" + text4; string key2 = "GT_ReqRevive_" + text2; bool flag11 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val2 in playerList) { if (val2 != null) { if (!string.IsNullOrEmpty(text4) && ((Dictionary)(object)val2.CustomProperties).TryGetValue((object)key, out object value16) && SafeConvertToInt(value16) != 0) { flag11 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val2.CustomProperties).TryGetValue((object)key2, out object value17) && SafeConvertToInt(value17) != 0) { flag11 = true; break; } } } if (flag11) { try { __instance.Revive(false); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] Self-revived by remote request: " + text4 + " / " + text2)); } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[Self Revive Error]: {arg}"); } } } } else { string key3 = "GT_ReqKill_" + text4; string key4 = "GT_ReqKill_" + text2; bool flag12 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val3 in playerList) { if (val3 != null) { if (!string.IsNullOrEmpty(text4) && ((Dictionary)(object)val3.CustomProperties).TryGetValue((object)key3, out object value18) && SafeConvertToInt(value18) != 0) { flag12 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val3.CustomProperties).TryGetValue((object)key4, out object value19) && SafeConvertToInt(value19) != 0) { flag12 = true; break; } } } if (flag12) { try { __instance.PlayerDeath(-1); Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogInfo((object)("[GameTools] Self-killed by remote request: " + text4 + " / " + text2)); } } catch (Exception arg2) { Plugin instance4 = Instance; if (instance4 != null) { ((BaseUnityPlugin)instance4).Logger.LogWarning((object)$"[Self Kill Error]: {arg2}"); } } } } if (!flag10 && (Object)(object)__instance.playerHealth != (Object)null) { string key5 = "GT_ReqHeal_" + text4; string key6 = "GT_ReqHeal_" + text2; bool flag13 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val4 in playerList) { if (val4 != null) { if (!string.IsNullOrEmpty(text4) && ((Dictionary)(object)val4.CustomProperties).TryGetValue((object)key5, out object value20) && SafeConvertToInt(value20) != 0) { flag13 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val4.CustomProperties).TryGetValue((object)key6, out object value21) && SafeConvertToInt(value21) != 0) { flag13 = true; break; } } } if (flag13) { try { int num12 = PlayerHealthMaxRef.Invoke(__instance.playerHealth); __instance.playerHealth.Heal(num12, true); Plugin instance5 = Instance; if (instance5 != null) { ((BaseUnityPlugin)instance5).Logger.LogInfo((object)("[GameTools] Self-healed by remote request: " + text4 + " / " + text2)); } } catch (Exception arg3) { Plugin instance6 = Instance; if (instance6 != null) { ((BaseUnityPlugin)instance6).Logger.LogWarning((object)$"[Self Heal Error]: {arg3}"); } } } } } if (IsTab1Enabled() && PhotonNetwork.IsMasterClient && (!string.IsNullOrEmpty(text2) || !string.IsNullOrEmpty(text3))) { if (flag10) { string key7 = "GT_ReqRevive_" + text3; string key8 = "GT_ReqRevive_" + text2; bool flag14 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val5 in playerList) { if (val5 != null) { if (!string.IsNullOrEmpty(text3) && ((Dictionary)(object)val5.CustomProperties).TryGetValue((object)key7, out object value22) && SafeConvertToInt(value22) != 0) { flag14 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val5.CustomProperties).TryGetValue((object)key8, out object value23) && SafeConvertToInt(value23) != 0) { flag14 = true; break; } } } if (flag14 && (Object)(object)__instance.photonView != (Object)null) { try { __instance.photonView.RPC("ReviveRPC", (RpcTarget)0, new object[1] { false }); Plugin instance7 = Instance; if (instance7 != null) { ((BaseUnityPlugin)instance7).Logger.LogInfo((object)("[GameTools] Host proxy-revived vanilla player: " + text3 + " / " + text2)); } } catch (Exception arg4) { Plugin instance8 = Instance; if (instance8 != null) { ((BaseUnityPlugin)instance8).Logger.LogWarning((object)$"[Host Proxy Revive Error]: {arg4}"); } } } } else { string key9 = "GT_ReqKill_" + text3; string key10 = "GT_ReqKill_" + text2; bool flag15 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val6 in playerList) { if (val6 != null) { if (!string.IsNullOrEmpty(text3) && ((Dictionary)(object)val6.CustomProperties).TryGetValue((object)key9, out object value24) && SafeConvertToInt(value24) != 0) { flag15 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val6.CustomProperties).TryGetValue((object)key10, out object value25) && SafeConvertToInt(value25) != 0) { flag15 = true; break; } } } if (flag15 && (Object)(object)__instance.photonView != (Object)null) { try { __instance.photonView.RPC("PlayerDeathRPC", (RpcTarget)0, new object[1] { -1 }); Plugin instance9 = Instance; if (instance9 != null) { ((BaseUnityPlugin)instance9).Logger.LogInfo((object)("[GameTools] Host proxy-killed vanilla player: " + text3 + " / " + text2)); } } catch (Exception arg5) { Plugin instance10 = Instance; if (instance10 != null) { ((BaseUnityPlugin)instance10).Logger.LogWarning((object)$"[Host Proxy Kill Error]: {arg5}"); } } } } if (!flag10 && (Object)(object)__instance.playerHealth != (Object)null) { string key11 = "GT_ReqHeal_" + text3; string key12 = "GT_ReqHeal_" + text2; bool flag16 = false; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val7 in playerList) { if (val7 != null) { if (!string.IsNullOrEmpty(text3) && ((Dictionary)(object)val7.CustomProperties).TryGetValue((object)key11, out object value26) && SafeConvertToInt(value26) != 0) { flag16 = true; break; } if (!string.IsNullOrEmpty(text2) && ((Dictionary)(object)val7.CustomProperties).TryGetValue((object)key12, out object value27) && SafeConvertToInt(value27) != 0) { flag16 = true; break; } } } if (flag16 && (Object)(object)__instance.photonView != (Object)null) { try { int num13 = PlayerHealthMaxRef.Invoke(__instance.playerHealth); __instance.photonView.RPC("UpdateHealthRPC", (RpcTarget)0, new object[4] { num13, num13, true, false }); Plugin instance11 = Instance; if (instance11 != null) { ((BaseUnityPlugin)instance11).Logger.LogInfo((object)("[GameTools] Host proxy-healed vanilla player: " + text3 + " / " + text2)); } } catch (Exception arg6) { Plugin instance12 = Instance; if (instance12 != null) { ((BaseUnityPlugin)instance12).Logger.LogWarning((object)$"[Host Proxy Heal Error]: {arg6}"); } } } } } if (PlayerAvatarIsLocalRef.Invoke(__instance)) { List list = SemiFunc.PlayerGetList(); if (list != null) { Hashtable val8 = new Hashtable(); bool flag17 = false; foreach (PlayerAvatar item in list) { if ((Object)(object)item == (Object)null) { continue; } string text5 = PlayerAvatarSteamIDRef.Invoke(item); string text6 = (((Object)(object)item.photonView != (Object)null && item.photonView.Owner != null) ? item.photonView.Owner.ActorNumber.ToString() : ""); bool num14 = PlayerAvatarDeadSetRef.Invoke(item); if (!num14) { string text7 = "GT_ReqRevive_" + text6; string text8 = "GT_ReqRevive_" + text5; if (!string.IsNullOrEmpty(text6) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text7, out object value28) && SafeConvertToInt(value28) != 0) { val8[(object)text7] = null; flag17 = true; } if (!string.IsNullOrEmpty(text5) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text8, out object value29) && SafeConvertToInt(value29) != 0) { val8[(object)text8] = null; flag17 = true; } } else { string text9 = "GT_ReqKill_" + text6; string text10 = "GT_ReqKill_" + text5; if (!string.IsNullOrEmpty(text6) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text9, out object value30) && SafeConvertToInt(value30) != 0) { val8[(object)text9] = null; flag17 = true; } if (!string.IsNullOrEmpty(text5) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text10, out object value31) && SafeConvertToInt(value31) != 0) { val8[(object)text10] = null; flag17 = true; } } if (num14 || !((Object)(object)item.playerHealth != (Object)null)) { continue; } int num15 = PlayerHealthCurrentRef.Invoke(item.playerHealth); int num16 = PlayerHealthMaxRef.Invoke(item.playerHealth); if (num15 >= num16) { string text11 = "GT_ReqHeal_" + text6; string text12 = "GT_ReqHeal_" + text5; if (!string.IsNullOrEmpty(text6) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text11, out object value32) && SafeConvertToInt(value32) != 0) { val8[(object)text11] = null; flag17 = true; } if (!string.IsNullOrEmpty(text5) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text12, out object value33) && SafeConvertToInt(value33) != 0) { val8[(object)text12] = null; flag17 = true; } } } if (flag17) { PhotonNetwork.LocalPlayer.SetCustomProperties(val8, (Hashtable)null, (WebFlags)null); Plugin instance13 = Instance; if (instance13 != null) { ((BaseUnityPlugin)instance13).Logger.LogInfo((object)"[GameTools] Cleared resolved player control requests."); } } } } if (PlayerAvatarIsLocalRef.Invoke(__instance)) { string text13 = PlayerAvatarSteamIDRef.Invoke(__instance); string text14 = ((PhotonNetwork.LocalPlayer != null) ? PhotonNetwork.LocalPlayer.ActorNumber.ToString() : ""); string key13 = "GT_ReqTeleport_" + text14; string key14 = "GT_ReqTeleport_" + text13; Vector3? val9 = null; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val10 in playerList) { if (val10 != null) { if (!string.IsNullOrEmpty(text14) && ((Dictionary)(object)val10.CustomProperties).TryGetValue((object)key13, out object value34) && value34 is float[] && ((float[])value34).Length == 3) { val9 = new Vector3(((float[])value34)[0], ((float[])value34)[1], ((float[])value34)[2]); break; } if (!string.IsNullOrEmpty(text13) && ((Dictionary)(object)val10.CustomProperties).TryGetValue((object)key14, out object value35) && value35 is float[] && ((float[])value35).Length == 3) { val9 = new Vector3(((float[])value35)[0], ((float[])value35)[1], ((float[])value35)[2]); break; } } } if (val9.HasValue) { Vector3 value36 = val9.Value; if (Vector3.Distance(_lastRemoteTpPos, value36) > 0.5f || Time.time - _lastRemoteTpTime > 1f) { _lastRemoteTpPos = value36; _lastRemoteTpTime = Time.time; try { if (PlayerAvatarDeadSetRef.Invoke(__instance)) { PlayerDeathHead val11 = PlayerAvatarPlayerDeathHeadRef.Invoke(__instance); if ((Object)(object)val11 != (Object)null) { PhysGrabObject val12 = PlayerDeathHeadPhysGrabObjectRef.Invoke(val11); if ((Object)(object)val12 != (Object)null) { val12.Teleport(value36, Quaternion.identity); } } } else { PlayerTumble val13 = PlayerAvatarTumbleRef.Invoke(__instance); if ((Object)(object)val13 != (Object)null) { PhysGrabObject val14 = PlayerTumblePhysGrabObjectRef.Invoke(val13); if ((Object)(object)val14 != (Object)null) { val14.Teleport(value36, Quaternion.identity); } } } if ((Object)(object)PlayerController.instance != (Object)null) { ((Component)PlayerController.instance).transform.position = value36; } Plugin instance14 = Instance; if (instance14 != null) { ((BaseUnityPlugin)instance14).Logger.LogInfo((object)$"[GameTools] Teleported self locally by remote request to {value36}"); } } catch (Exception arg7) { Plugin instance15 = Instance; if (instance15 != null) { ((BaseUnityPlugin)instance15).Logger.LogWarning((object)$"[Self Teleport By Remote Error]: {arg7}"); } } } } } if (PlayerAvatarIsLocalRef.Invoke(__instance)) { List list2 = SemiFunc.PlayerGetList(); if (list2 != null) { Hashtable val15 = new Hashtable(); bool flag18 = false; Vector3 val16 = default(Vector3); Vector3 val17 = default(Vector3); foreach (PlayerAvatar item2 in list2) { if ((Object)(object)item2 == (Object)null) { continue; } string text15 = PlayerAvatarSteamIDRef.Invoke(item2); string text16 = (((Object)(object)item2.photonView != (Object)null && item2.photonView.Owner != null) ? item2.photonView.Owner.ActorNumber.ToString() : ""); string text17 = "GT_ReqTeleport_" + text16; string text18 = "GT_ReqTeleport_" + text15; if (!string.IsNullOrEmpty(text16) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text17, out object value37) && value37 is float[] && ((float[])value37).Length == 3) { ((Vector3)(ref val16))..ctor(((float[])value37)[0], ((float[])value37)[1], ((float[])value37)[2]); if (Vector3.Distance(GetPlayerPosition(item2), val16) < 3f) { val15[(object)text17] = null; flag18 = true; } } if (!string.IsNullOrEmpty(text15) && ((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)text18, out object value38) && value38 is float[] && ((float[])value38).Length == 3) { ((Vector3)(ref val17))..ctor(((float[])value38)[0], ((float[])value38)[1], ((float[])value38)[2]); if (Vector3.Distance(GetPlayerPosition(item2), val17) < 3f) { val15[(object)text18] = null; flag18 = true; } } } if (flag18) { PhotonNetwork.LocalPlayer.SetCustomProperties(val15, (Hashtable)null, (WebFlags)null); Plugin instance16 = Instance; if (instance16 != null) { ((BaseUnityPlugin)instance16).Logger.LogInfo((object)"[GameTools] Cleared resolved teleport requests."); } } } } } } catch (Exception arg8) { Plugin instance17 = Instance; if (instance17 != null) { ((BaseUnityPlugin)instance17).Logger.LogWarning((object)$"[PlayerAvatar.Update.Postfix Error]: {arg8}"); } } try { bool flag19 = false; bool flag20 = false; float num17 = 1f; if (PhotonNetwork.InRoom && (Object)(object)__instance.photonView != (Object)null && __instance.photonView.Owner != null) { Hashtable customProperties = __instance.photonView.Owner.CustomProperties; if (((Dictionary)(object)customProperties).TryGetValue((object)"GT_EyeBigPupil", out object value39) && value39 is bool) { flag19 = (bool)value39; } if (((Dictionary)(object)customProperties).TryGetValue((object)"GT_EyeBigPupilAuto", out object value40) && value40 is bool) { flag20 = (bool)value40; } if (((Dictionary)(object)customProperties).TryGetValue((object)"GT_EyeBigPupilSpeed", out object value41)) { try { num17 = Convert.ToSingle(value41); } catch { } } } else if (PlayerAvatarIsLocalRef.Invoke(__instance)) { flag19 = IsCosmeticsEnabled() && _cfgEyeBigPupil != null && _cfgEyeBigPupil.Value; flag20 = IsCosmeticsEnabled() && _cfgEyePupilScaleAuto != null && _cfgEyePupilScaleAuto.Value; num17 = ((_cfgEyePupilScaleSpeed != null) ? _cfgEyePupilScaleSpeed.Value : 1f); } if (PlayerAvatarIsLocalRef.Invoke(__instance) && PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { bool flag21 = IsCosmeticsEnabled() && _cfgEyeBigPupil != null && _cfgEyeBigPupil.Value; bool flag22 = IsCosmeticsEnabled() && _cfgEyePupilScaleAuto != null && _cfgEyePupilScaleAuto.Value; float num18 = ((_cfgEyePupilScaleSpeed != null) ? _cfgEyePupilScaleSpeed.Value : 1f); bool flag23 = false; bool flag24 = false; float num19 = 1f; Hashtable customProperties2 = PhotonNetwork.LocalPlayer.CustomProperties; if (((Dictionary)(object)customProperties2).TryGetValue((object)"GT_EyeBigPupil", out object value42) && value42 is bool flag25) { flag23 = flag25; } if (((Dictionary)(object)customProperties2).TryGetValue((object)"GT_EyeBigPupilAuto", out object value43) && value43 is bool flag26) { flag24 = flag26; } if (((Dictionary)(object)customProperties2).TryGetValue((object)"GT_EyeBigPupilSpeed", out object value44)) { try { num19 = Convert.ToSingle(value44); } catch { } } if (flag23 != flag21 || flag24 != flag22 || Mathf.Abs(num19 - num18) > 0.05f) { Hashtable val18 = new Hashtable(); val18[(object)"GT_EyeBigPupil"] = flag21; val18[(object)"GT_EyeBigPupilAuto"] = flag22; val18[(object)"GT_EyeBigPupilSpeed"] = num18; PhotonNetwork.LocalPlayer.SetCustomProperties(val18, (Hashtable)null, (WebFlags)null); } } if (_cfgModEnabled != null && _cfgModEnabled.Value && flag19) { float num20 = 3f; if (flag20) { double num21 = (PhotonNetwork.InRoom ? PhotonNetwork.Time : ((double)Time.time)); num20 = 2f + 1.2f * Mathf.Sin((float)(num21 * (double)num17 * 3.0)); } __instance.OverridePupilSize(num20, 4, 1f, 1f, 5f, 0.5f, 0.5f); } int num22 = 0; if (PhotonNetwork.InRoom && (Object)(object)__instance.photonView != (Object)null && __instance.photonView.Owner != null) { if (((Dictionary)(object)__instance.photonView.Owner.CustomProperties).TryGetValue((object)"GT_EyeEffect", out object value45)) { num22 = SafeConvertToInt(value45); } } else if (PlayerAvatarIsLocalRef.Invoke(__instance) && IsCosmeticsEnabled() && _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value) { num22 = CurrentEyeColor; } if (_cfgModEnabled == null || !_cfgModEnabled.Value) { return; } switch (num22) { case 2: if ((Object)(object)__instance.playerHealth != (Object)null) { __instance.playerHealth.EyeMaterialOverride((EyeOverrideState)1, 0.5f, 999); } break; case 3: if ((Object)(object)__instance.playerHealth != (Object)null) { __instance.playerHealth.EyeMaterialOverride((EyeOverrideState)2, 0.5f, 999); } break; case 4: if ((Object)(object)__instance.playerHealth != (Object)null) { EyeOverrideState val19 = (EyeOverrideState)(((int)(Time.time * 2f) % 2 == 0) ? 1 : 2); __instance.playerHealth.EyeMaterialOverride(val19, 0.5f, 999); } break; case 5: if ((Object)(object)__instance.playerHealth != (Object)null) { __instance.playerHealth.EyeMaterialOverride((EyeOverrideState)3, 0.5f, 999); } break; case 6: if ((Object)(object)__instance.playerHealth != (Object)null) { __instance.playerHealth.EyeMaterialOverride((EyeOverrideState)4, 0.5f, 999); } break; case 7: if ((Object)(object)__instance.playerHealth != (Object)null) { __instance.playerHealth.EyeMaterialOverride((EyeOverrideState)5, 0.5f, 999); } break; } } catch (Exception arg9) { Plugin instance18 = Instance; if (instance18 != null) { ((BaseUnityPlugin)instance18).Logger.LogWarning((object)$"[PlayerAvatar.Update.EyeEffect Error]: {arg9}"); } } } } [HarmonyPatch(typeof(PlayerController), "Update")] private class PlayerController_Update_Patch { private static float _originalJumpForce = -1f; private static bool _prevGodModeFlightEnabled = false; private static readonly FieldRef _fIsTumbling = AccessTools.FieldRefAccess("isTumbling"); private static readonly FieldRef _fTumble = AccessTools.FieldRefAccess("tumble"); [HarmonyPostfix] private static void Postfix(PlayerController __instance) { bool flag = IsStaticModEnabled() && IsJumpMultiplierEnabled(); try { if ((Object)(object)__instance == (Object)(object)PlayerController.instance) { if (_originalJumpForce < 0f) { _originalJumpForce = __instance.JumpForce; } if (flag) { __instance.JumpForce = _originalJumpForce * GetJumpMultiplier(); } else if (__instance.JumpForce != _originalJumpForce && _originalJumpForce >= 0f) { __instance.JumpForce = _originalJumpForce; } UpdateGodModeFlight(__instance); UpdateAllTeammatesGodMode(); __instance.DebugEnergy = IsInfiniteStaminaEnabled(); } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerController.Update.JumpForce Patch Error]: {arg}"); } } } private static void UpdateGodModeFlight(PlayerController player) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_014a: 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_0151: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) if (IsStaticModEnabled() && IsGodModeFlightEnabled()) { if (!_prevGodModeFlightEnabled) { _prevGodModeFlightEnabled = true; if ((Object)(object)PlayerAvatar.instance != (Object)null) { string text = PlayerAvatarSteamIDRef.Invoke(PlayerAvatar.instance); if (!string.IsNullOrEmpty(text)) { SetPlayerFlightGodMode(text, enable: true); } } } if ((Object)(object)player.playerAvatarScript != (Object)null) { bool num = _fIsTumbling.Invoke(player.playerAvatarScript); PlayerTumble val = _fTumble.Invoke(player.playerAvatarScript); if (num && (Object)(object)val != (Object)null) { val.TumbleRequest(false, false); } } if ((Object)(object)player.rb != (Object)null) { player.rb.isKinematic = true; player.rb.useGravity = false; player.rb.velocity = Vector3.zero; } if ((Object)(object)player.col != (Object)null && player.col.enabled) { player.col.enabled = false; } float num2 = 12f; if (SemiFunc.InputHold((InputKey)15) || player.sprinting) { num2 = 28f; } float num3 = SemiFunc.InputMovementX(); float num4 = SemiFunc.InputMovementY(); Vector3 val2 = Vector3.zero; Camera mainCamera = GetMainCamera(); if ((Object)(object)mainCamera != (Object)null) { Vector3 forward = ((Component)mainCamera).transform.forward; Vector3 right = ((Component)mainCamera).transform.right; val2 += forward * num4; val2 += right * num3; } else { val2 += ((Component)player).transform.forward * num4; val2 += ((Component)player).transform.right * num3; } if (SemiFunc.InputHold((InputKey)1)) { val2 += Vector3.up; } if (SemiFunc.InputHold((InputKey)12)) { val2 -= Vector3.up; } if (((Vector3)(ref val2)).sqrMagnitude > 0.001f) { Transform transform = ((Component)player).transform; transform.position += ((Vector3)(ref val2)).normalized * num2 * Time.deltaTime; } } else { if (!_prevGodModeFlightEnabled) { return; } _prevGodModeFlightEnabled = false; if ((Object)(object)PlayerAvatar.instance != (Object)null) { string text2 = PlayerAvatarSteamIDRef.Invoke(PlayerAvatar.instance); if (!string.IsNullOrEmpty(text2)) { SetPlayerFlightGodMode(text2, enable: false); } } if ((Object)(object)player.rb != (Object)null) { player.rb.isKinematic = false; player.rb.useGravity = true; } if ((Object)(object)player.col != (Object)null) { player.col.enabled = true; } } } } [HarmonyPatch(typeof(ItemUpgradePlayerTumbleWingsLogic), "TumbleWingPinkTimerUpdate")] private class ItemUpgradePlayerTumbleWingsLogic_TumbleWingPinkTimerUpdate_Patch { [HarmonyPrefix] private static bool Prefix(ItemUpgradePlayerTumbleWingsLogic __instance) { if (IsStaticModEnabled() && IsWingsAlwaysShowEnabled()) { return false; } return true; } } [HarmonyPatch(typeof(ItemUpgradePlayerTumbleWingsLogic), "TurnOffWings")] private class ItemUpgradePlayerTumbleWingsLogic_TurnOffWings_Patch { [HarmonyPrefix] private static bool Prefix(ItemUpgradePlayerTumbleWingsLogic __instance) { if (IsStaticModEnabled() && IsWingsAlwaysShowEnabled()) { return false; } return true; } } [HarmonyPatch(typeof(ItemUpgradePlayerTumbleWingsLogic), "LoopSound")] private class ItemUpgradePlayerTumbleWingsLogic_LoopSound_Patch { [HarmonyPrefix] private static bool Prefix(ItemUpgradePlayerTumbleWingsLogic __instance) { if (!IsWingsSoundEnabled()) { try { if (__instance.soundWingsLoop != null) { __instance.soundWingsLoop.PlayLoop(false, 2f, 2f, 1f, 1f); } } catch { } return false; } return true; } } [HarmonyPatch(typeof(ItemUpgradePlayerTumbleWingsLogic), "FixedUpdate")] private class ItemUpgradePlayerTumbleWingsLogic_FixedUpdate_Patch { [HarmonyPostfix] private static void Postfix(ItemUpgradePlayerTumbleWingsLogic __instance) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if (!IsStaticModEnabled() || !IsTumbleFlyEnabled()) { return; } try { if (!((Object)(object)__instance.playerAvatar != (Object)null) || !PlayerAvatarIsLocalRef.Invoke(__instance.playerAvatar)) { return; } PlayerTumble val = WingsPlayerTumbleRef.Invoke(__instance); PhysGrabObject val2 = (((Object)(object)val != (Object)null) ? PlayerTumblePhysGrabObjectRef.Invoke(val) : null); Keyboard current = Keyboard.current; if (current == null || !((ButtonControl)current.qKey).isPressed || !((Object)(object)val != (Object)null) || !PlayerTumbleIsTumblingRef.Invoke(val) || !((Object)(object)val2 != (Object)null) || !((Object)(object)val2.rb != (Object)null)) { return; } Transform overrideTransform = __instance.playerAvatar.localCamera.GetOverrideTransform(); if ((Object)(object)overrideTransform != (Object)null) { val.DisableCustomGravity(0.1f); Vector3 forward = overrideTransform.forward; float num = 16f; Vector3 val3 = forward * num; val2.rb.velocity = Vector3.Lerp(val2.rb.velocity, val3, 0.35f); val.OverrideLookAtCamera(0.1f, 10f, 5f); if (!PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance.playerAvatar)) { __instance.playerAvatar.UpgradeTumbleWingsVisualsActive(true, false); PlayerAvatarUpgradeTumbleWingsVisualsActiveRef.Invoke(__instance.playerAvatar) = true; } TumbleWingTimerRef.Invoke(__instance) = 1f; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[ItemUpgradePlayerTumbleWingsLogic.FixedUpdate Patch Error]: {arg}"); } } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] private class EnemyParent_Despawn_Patch { [HarmonyPostfix] private static void Postfix(EnemyParent __instance) { if (!IsTab4Enabled() || (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient)) { return; } try { if (!((Object)(object)((Component)__instance).GetComponent() != (Object)null) || _cfgSpawnedAutoRespawn) { return; } Enemy val = EnemyParentEnemyRef.Invoke(__instance); if (!((Object)(object)val != (Object)null)) { return; } EnemyHealth val2 = EnemyHealthRef.Invoke(val); if (!((Object)(object)val2 != (Object)null) || EnemyHealthCurrentRef.Invoke(val2) > 0) { return; } if ((Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { EnemyDirector.instance.enemiesSpawned.Remove(__instance); } if (PhotonNetwork.InRoom) { if (PhotonNetwork.IsMasterClient) { PhotonNetwork.Destroy(((Component)__instance).gameObject); } } else { Object.Destroy((Object)(object)((Component)__instance).gameObject); } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[EnemyParent.Despawn Postfix Error]: {arg}"); } } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] private class EnemyDirector_AmountSetup_Patch { private static readonly MethodInfo pickMethod = typeof(EnemyDirector).GetMethod("PickEnemies", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPostfix] private static void Postfix(EnemyDirector __instance) { if (!IsTab5Enabled() || (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient)) { return; } try { float spawnRateMultiplier = GetSpawnRateMultiplier(); if (!(spawnRateMultiplier > 1f)) { return; } int num = EnemyDirectorAmountCurve1ValueRef.Invoke(__instance); int num2 = EnemyDirectorAmountCurve2ValueRef.Invoke(__instance); int num3 = EnemyDirectorAmountCurve3ValueRef.Invoke(__instance); int num4 = Mathf.RoundToInt((float)num * (spawnRateMultiplier - 1f)); int num5 = Mathf.RoundToInt((float)num2 * (spawnRateMultiplier - 1f)); int num6 = Mathf.RoundToInt((float)num3 * (spawnRateMultiplier - 1f)); if (pickMethod != null) { object[] array = new object[1]; for (int i = 0; i < num6; i++) { array[0] = __instance.enemiesDifficulty3; pickMethod.Invoke(__instance, array); } for (int j = 0; j < num5; j++) { array[0] = __instance.enemiesDifficulty2; pickMethod.Invoke(__instance, array); } for (int k = 0; k < num4; k++) { array[0] = __instance.enemiesDifficulty1; pickMethod.Invoke(__instance, array); } } EnemyDirectorAmountCurve1ValueRef.Invoke(__instance) = num + num4; EnemyDirectorAmountCurve2ValueRef.Invoke(__instance) = num2 + num5; EnemyDirectorAmountCurve3ValueRef.Invoke(__instance) = num3 + num6; EnemyDirectorTotalAmountRef.Invoke(__instance) = EnemyDirectorTotalAmountRef.Invoke(__instance) + num4 + num5 + num6; Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)$"[GameTools] Spawn Multiplier {spawnRateMultiplier}x applied! Added slots: Difficulty1={num4}, Difficulty2={num5}, Difficulty3={num6}. Total slots: {EnemyDirectorTotalAmountRef.Invoke(__instance)}"); } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[EnemyDirector.AmountSetup Postfix Error]: {arg}"); } } } } [HarmonyPatch(typeof(ItemBattery), "Update")] private class ItemBattery_Update_Patch { [HarmonyPrefix] private static void Prefix(ItemBattery __instance, ref float __state) { __state = -1f; if (IsStaticModEnabled() && ShouldBatteryBeInfinite(__instance)) { __state = __instance.batteryLife; } } [HarmonyPostfix] private static void Postfix(ItemBattery __instance, float __state) { if (IsStaticModEnabled() && ShouldBatteryBeInfinite(__instance)) { __instance.batteryLife = 100f; ItemBatteryBatteryLifeIntRef.Invoke(__instance) = __instance.batteryBars; } else if (__state >= 0f) { __instance.batteryLife = __state; } } } [HarmonyPatch(typeof(ItemBattery), "Drain")] private class ItemBattery_Drain_Patch { [HarmonyPrefix] private static bool Prefix(ItemBattery __instance) { if (IsStaticModEnabled() && ShouldBatteryBeInfinite(__instance)) { return false; } return true; } } [HarmonyPatch(typeof(ItemBattery), "RemoveFullBar")] private class ItemBattery_RemoveFullBar_Patch { [HarmonyPrefix] private static bool Prefix(ItemBattery __instance) { if (IsStaticModEnabled() && ShouldBatteryBeInfinite(__instance)) { return false; } return true; } } [HarmonyPatch(typeof(PlayerDeathHead), "SeenSetRPC")] private class PlayerDeathHead_SeenSetRPC_Patch { [HarmonyPostfix] private static void Postfix(PlayerDeathHead __instance, bool _toggle) { if (!_toggle || !IsStaticModEnabled() || !IsAutoReviveWhenSeenEnabled()) { return; } try { PlayerAvatar playerAvatar = __instance.playerAvatar; if ((Object)(object)playerAvatar != (Object)null && PlayerAvatarDeadSetRef.Invoke(playerAvatar) && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient || PlayerAvatarIsLocalRef.Invoke(playerAvatar))) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] Player " + ((Object)playerAvatar).name + " death head was seen by teammates. Triggering auto revive!")); } HandleReviveAndTeleport(playerAvatar); } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[PlayerDeathHead.SeenSetRPC Postfix Error]: {arg}"); } } } } [HarmonyPatch(typeof(PlayerDeathHead), "Update")] private class PlayerDeathHead_Update_Patch { private static readonly Dictionary _reviveCooldown = new Dictionary(); private static readonly Dictionary _nextCheckTime = new Dictionary(); private static readonly FieldRef _fPhysGrabObjRef = AccessTools.FieldRefAccess("physGrabObject"); private static readonly FieldRef _fPhotonViewRef = AccessTools.FieldRefAccess("photonView"); private static readonly FieldRef _fRoomVolumeCheckRef = AccessTools.FieldRefAccess("roomVolumeCheck"); private static readonly FieldRef _fRoomInTruckRef = AccessTools.FieldRefAccess("inTruck"); private static readonly FieldRef _fRoomInExtractionRef = AccessTools.FieldRefAccess("inExtractionPoint"); [HarmonyPostfix] private static void Postfix(PlayerDeathHead __instance) { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_01d0: Unknown result type (might be due to invalid IL or missing references) if (!IsStaticModEnabled()) { return; } PlayerAvatar playerAvatar = __instance.playerAvatar; if ((Object)(object)playerAvatar == (Object)null || !PlayerAvatarDeadSetRef.Invoke(playerAvatar)) { return; } bool num = SemiFunc.IsMasterClientOrSingleplayer(); bool flag = PlayerAvatarIsLocalRef.Invoke(playerAvatar); if (!num && !flag) { return; } PhotonView val = _fPhotonViewRef.Invoke(__instance); int key = (((Object)(object)val != (Object)null) ? val.ViewID : ((Object)__instance).GetInstanceID()); if (_reviveCooldown.TryGetValue(key, out var value) && value > 0f) { _reviveCooldown[key] = value - Time.deltaTime; return; } float time = Time.time; if (_nextCheckTime.TryGetValue(key, out var value2) && time < value2) { return; } _nextCheckTime[key] = time + 1f; PhysGrabObject val2 = _fPhysGrabObjRef.Invoke(__instance); if ((Object)(object)val2 == (Object)null) { return; } bool flag2 = false; bool flag3 = false; bool flag4 = false; RoomVolumeCheck val3 = _fRoomVolumeCheckRef.Invoke(__instance); if ((Object)(object)val3 != (Object)null) { flag3 = _fRoomInTruckRef.Invoke(val3); flag4 = _fRoomInExtractionRef.Invoke(val3); } if (IsReviveHeadOnTruck() && flag3) { flag2 = true; Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] " + ((Object)playerAvatar).name + " death head is IN TRUCK → auto revive!")); } } if (!flag2 && IsReviveHeadOnExtraction() && flag4) { flag2 = true; Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)("[GameTools] " + ((Object)playerAvatar).name + " death head is AT EXTRACTION POINT → auto revive!")); } } if (!flag2 && IsReviveHeadOnCart()) { try { PhysGrabCart[] array = Object.FindObjectsOfType(); Vector3 centerPoint = val2.centerPoint; PhysGrabCart[] array2 = array; foreach (PhysGrabCart val4 in array2) { if ((Object)(object)val4 != (Object)null && Vector3.Distance(centerPoint, ((Component)val4).transform.position) <= 0.8f) { flag2 = true; Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogInfo((object)("[GameTools] " + ((Object)playerAvatar).name + " death head is ON CART (" + ((Object)val4).name + ") → auto revive!")); } break; } } } catch (Exception arg) { Plugin instance4 = Instance; if (instance4 != null) { ((BaseUnityPlugin)instance4).Logger.LogWarning((object)$"[PlayerDeathHead_Update_Patch Cart Error]: {arg}"); } } } if (flag2) { _reviveCooldown[key] = 5f; HandleReviveAndTeleport(playerAvatar); } } } [HarmonyPatch(typeof(PlayerTumble), "TumbleRequest")] private class PlayerTumble_TumbleRequest_Patch { [HarmonyPrefix] private static bool Prefix(PlayerTumble __instance, bool _isTumbling, bool _playerInput) { if (!_isTumbling || _playerInput) { return true; } if (!IsStaticModEnabled()) { return true; } try { PlayerAvatar playerAvatar = __instance.playerAvatar; if ((Object)(object)playerAvatar == (Object)null) { return true; } string steamID = PlayerAvatarSteamIDRef.Invoke(playerAvatar); if (IsAllTeammatesGodModeEnabled() || IsPlayerGodMode(steamID) || IsPlayerTempGodMode(steamID)) { return false; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerTumble_TumbleRequest_Patch Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] private class PlayerHealth_Hurt_Patch { [HarmonyPrefix] private static bool Prefix(PlayerHealth __instance) { if (!IsStaticModEnabled()) { return true; } try { PlayerAvatar val = PlayerHealthAvatarRef.Invoke(__instance); if ((Object)(object)val != (Object)null) { string steamID = PlayerAvatarSteamIDRef.Invoke(val); if (PlayerAvatarIsLocalRef.Invoke(val)) { if (IsPlayerGodMode(steamID)) { PlayerHealthCurrentRef.Invoke(__instance) = PlayerHealthMaxRef.Invoke(__instance); return false; } if (IsPlayerTempGodMode(steamID)) { return false; } } else if (PhotonNetwork.IsMasterClient && IsPlayerGodMode(steamID)) { PlayerHealthCurrentRef.Invoke(__instance) = PlayerHealthMaxRef.Invoke(__instance); if ((Object)(object)val.photonView != (Object)null) { int num = PlayerHealthMaxRef.Invoke(__instance); val.photonView.RPC("UpdateHealthRPC", (RpcTarget)0, new object[4] { num, num, true, false }); } return false; } } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerHealth.Hurt Patch Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Update")] private class PlayerHealth_Update_Patch { [HarmonyPrefix] private static void Prefix(PlayerHealth __instance) { if (!IsStaticModEnabled()) { return; } try { PlayerAvatar val = PlayerHealthAvatarRef.Invoke(__instance); if (!((Object)(object)val != (Object)null)) { return; } string steamID = PlayerAvatarSteamIDRef.Invoke(val); if (PlayerAvatarIsLocalRef.Invoke(val) && IsPlayerGodMode(steamID)) { int num = PlayerHealthMaxRef.Invoke(__instance); if (PlayerHealthCurrentRef.Invoke(__instance) < num) { PlayerHealthCurrentRef.Invoke(__instance) = num; } } else { if (PlayerAvatarIsLocalRef.Invoke(val) || !PhotonNetwork.IsMasterClient || !IsPlayerGodMode(steamID)) { return; } int num2 = PlayerHealthMaxRef.Invoke(__instance); if (PlayerHealthCurrentRef.Invoke(__instance) < num2) { PlayerHealthCurrentRef.Invoke(__instance) = num2; if ((Object)(object)val.photonView != (Object)null) { val.photonView.RPC("UpdateHealthRPC", (RpcTarget)0, new object[4] { num2, num2, true, false }); } } } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerHealth.Update Patch Error]: {arg}"); } } } } [HarmonyPatch(typeof(PlayerHealth), "HurtOther")] private class PlayerHealth_HurtOther_Patch { [HarmonyPrefix] private static bool Prefix(PlayerHealth __instance) { if (!IsStaticModEnabled()) { return true; } try { PlayerAvatar val = PlayerHealthAvatarRef.Invoke(__instance); if ((Object)(object)val != (Object)null && IsPlayerGodMode(PlayerAvatarSteamIDRef.Invoke(val))) { return false; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerHealth.HurtOther Patch Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(PlayerHealth), "HurtOtherRPC")] private class PlayerHealth_HurtOtherRPC_Patch { [HarmonyPrefix] private static bool Prefix(PlayerHealth __instance) { if (!IsStaticModEnabled()) { return true; } try { PlayerAvatar val = PlayerHealthAvatarRef.Invoke(__instance); if ((Object)(object)val != (Object)null && IsPlayerGodMode(PlayerAvatarSteamIDRef.Invoke(val))) { return false; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerHealth.HurtOtherRPC Patch Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Death")] private class PlayerHealth_Death_Patch { [HarmonyPrefix] private static bool Prefix(PlayerHealth __instance) { if (!IsStaticModEnabled()) { return true; } try { PlayerAvatar val = PlayerHealthAvatarRef.Invoke(__instance); if ((Object)(object)val != (Object)null && IsPlayerGodMode(PlayerAvatarSteamIDRef.Invoke(val))) { return false; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[PlayerHealth.Death Patch Error]: {arg}"); } } return true; } } [HarmonyPatch(typeof(CameraPosition), "Awake")] private class CameraPosition_Awake_Patch { [HarmonyPostfix] private static void Postfix() { CameraPosition_Update_Patch.ResetState(); GameToolsVisuals.ResetLocalState(); } } [HarmonyPatch(typeof(CameraPosition), "Update")] private class CameraPosition_Update_Patch { private static readonly int CameraCollisionLayerMask = LayerMask.GetMask(new string[3] { "Default", "World", "Terrain" }); private static bool _prevThirdPersonEnabled = false; private static Vector3 _lastMainCamLocalPos = Vector3.zero; public static void ResetState() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) _prevThirdPersonEnabled = false; _lastMainCamLocalPos = Vector3.zero; } [HarmonyPrefix] private static void Prefix(CameraPosition __instance) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (_cfgModEnabled == null || !_cfgModEnabled.Value) { return; } try { bool flag = IsThirdPersonEnabled(); bool flag2 = CameraPositionOverridePositionActiveRef.Invoke(__instance) || CameraPositionOverridePositionTimerRef.Invoke(__instance) > 0f; if ((Object)(object)PlayerAvatar.instance != (Object)null && PlayerAvatarIsLocalRef.Invoke(PlayerAvatar.instance) && flag && _prevThirdPersonEnabled && !flag2) { Camera mainCamera = GetMainCamera(); if ((Object)(object)mainCamera != (Object)null) { ((Component)mainCamera).transform.localPosition = _lastMainCamLocalPos; } } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[CameraPosition.Update Prefix Patch Error]: {arg}"); } } } [HarmonyPostfix] private static void Postfix(CameraPosition __instance) { //IL_0285: 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_0096: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) if (_cfgModEnabled == null || !_cfgModEnabled.Value) { return; } try { bool flag = IsThirdPersonEnabled(); bool flag2 = CameraPositionOverridePositionActiveRef.Invoke(__instance) || CameraPositionOverridePositionTimerRef.Invoke(__instance) > 0f; if (!((Object)(object)PlayerAvatar.instance != (Object)null) || !PlayerAvatarIsLocalRef.Invoke(PlayerAvatar.instance)) { return; } if (flag && !flag2) { Camera mainCamera = GetMainCamera(); if (!((Object)(object)mainCamera != (Object)null)) { return; } if (!_prevThirdPersonEnabled) { _prevThirdPersonEnabled = true; _lastMainCamLocalPos = ((Component)mainCamera).transform.localPosition; } if ((Object)(object)PlayerAvatar.instance.playerAvatarVisuals != (Object)null) { PlayerAvatar.instance.playerAvatarVisuals.ShowSelfOverride(0.5f); float thirdPersonModelScale = GetThirdPersonModelScale(); ((Component)PlayerAvatar.instance.playerAvatarVisuals).transform.localScale = new Vector3(thirdPersonModelScale, thirdPersonModelScale, thirdPersonModelScale); } PhysGrabber physGrabber = PlayerAvatar.instance.physGrabber; if (physGrabber != null) { physGrabber.SetThirdPerson(true); } FlashlightController flashlightController = PlayerAvatar.instance.flashlightController; if (flashlightController != null) { flashlightController.SetThirdPerson(true); } if ((Object)(object)PlayerAvatar.instance.playerAvatarVisuals != (Object)null) { PlayerAvatarRightArm val = PlayerAvatarVisualsRightArmRef.Invoke(PlayerAvatar.instance.playerAvatarVisuals); if ((Object)(object)val != (Object)null && (Object)(object)val.grabberOrb != (Object)null) { ((Component)val.grabberOrb).gameObject.SetActive(false); } } _lastMainCamLocalPos = ((Component)mainCamera).transform.localPosition; Vector3 position = ((Component)mainCamera).transform.position; Quaternion rotation = ((Component)mainCamera).transform.rotation; float thirdPersonDistance = GetThirdPersonDistance(); float thirdPersonHeight = GetThirdPersonHeight(); float thirdPersonHorizontal = GetThirdPersonHorizontal(); Vector3 val2 = rotation * Vector3.forward; Vector3 val3 = rotation * Vector3.right; Vector3 val4 = -val2 * thirdPersonDistance + Vector3.up * thirdPersonHeight + val3 * thirdPersonHorizontal; float magnitude = ((Vector3)(ref val4)).magnitude; Vector3 normalized = ((Vector3)(ref val4)).normalized; Vector3 position2 = position + val4; RaycastHit val5 = default(RaycastHit); if (Physics.SphereCast(position, 0.2f, normalized, ref val5, magnitude, CameraCollisionLayerMask, (QueryTriggerInteraction)1)) { position2 = position + normalized * Mathf.Max(0.1f, ((RaycastHit)(ref val5)).distance - 0.05f); } ((Component)mainCamera).transform.position = position2; } else { if (!_prevThirdPersonEnabled) { return; } _prevThirdPersonEnabled = false; Camera mainCamera2 = GetMainCamera(); if ((Object)(object)mainCamera2 != (Object)null) { ((Component)mainCamera2).transform.localPosition = _lastMainCamLocalPos; } if ((Object)(object)PlayerAvatar.instance.playerAvatarVisuals != (Object)null) { PlayerAvatar.instance.playerAvatarVisuals.ShowSelfOverride(0f); ((Component)PlayerAvatar.instance.playerAvatarVisuals).transform.localScale = Vector3.one; } if (!flag) { PhysGrabber physGrabber2 = PlayerAvatar.instance.physGrabber; if (physGrabber2 != null) { physGrabber2.SetThirdPerson(false); } FlashlightController flashlightController2 = PlayerAvatar.instance.flashlightController; if (flashlightController2 != null) { flashlightController2.SetThirdPerson(false); } } } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[CameraPosition.Update Postfix Patch Error]: {arg}"); } } } } [HarmonyPatch(typeof(FlashlightController), "Update")] private class FlashlightController_Update_Patch { private static readonly FieldRef _fHiddenScale = AccessTools.FieldRefAccess("hiddenScale"); private static readonly ConditionalWeakTable _lightCache = new ConditionalWeakTable(); [HarmonyPostfix] private static void Postfix(FlashlightController __instance) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: 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_01c6: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) if (_cfgModEnabled == null || !_cfgModEnabled.Value) { return; } try { if ((Object)(object)__instance.PlayerAvatar != (Object)null && PlayerAvatarIsLocalRef.Invoke(__instance.PlayerAvatar) && IsThirdPersonEnabled() && (Object)(object)__instance.FollowTransformClient != (Object)null) { float num = _fHiddenScale.Invoke(__instance); ((Component)__instance).transform.position = __instance.FollowTransformClient.position; ((Component)__instance).transform.rotation = __instance.FollowTransformClient.rotation; ((Component)__instance).transform.localScale = __instance.FollowTransformClient.localScale * num * GetThirdPersonModelScale(); if ((Object)(object)__instance.meshShadows != (Object)null) { ((Component)__instance.meshShadows).transform.position = __instance.FollowTransformClient.position; ((Component)__instance.meshShadows).transform.rotation = __instance.FollowTransformClient.rotation; ((Component)__instance.meshShadows).transform.localScale = ((Component)__instance.mesh).transform.localScale * GetThirdPersonModelScale(); } } if (!((Object)(object)__instance.PlayerAvatar != (Object)null)) { return; } int num2 = 0; object value2; if (PlayerAvatarIsLocalRef.Invoke(__instance.PlayerAvatar)) { if (IsCosmeticsEnabled() && _cfgFlashlightColorEnabled != null && _cfgFlashlightColorEnabled.Value) { num2 = ((_cfgFlashlightColor != null) ? _cfgFlashlightColor.Value : 0); } if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { int num3 = 0; if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_FlashlightColor", out object value)) { num3 = SafeConvertToInt(value); } if (num3 != num2) { Hashtable val = new Hashtable(); val[(object)"GT_FlashlightColor"] = num2; PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } } else if (PhotonNetwork.InRoom && (Object)(object)__instance.PlayerAvatar.photonView != (Object)null && __instance.PlayerAvatar.photonView.Owner != null && ((Dictionary)(object)__instance.PlayerAvatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_FlashlightColor", out value2)) { num2 = SafeConvertToInt(value2); } if (!_lightCache.TryGetValue(__instance, out var value3)) { value3 = ((Component)__instance).GetComponentsInChildren(true); _lightCache.Add(__instance, value3); } if (value3 == null || value3.Length == 0) { return; } Color flashlightColorValue = GetFlashlightColorValue(num2); Light[] array = value3; foreach (Light val2 in array) { if ((Object)(object)val2 != (Object)null) { val2.color = flashlightColorValue; } } } catch (Exception arg) { LogWarning($"[FlashlightController.Update Postfix Patch Error]: {arg}"); } } } [HarmonyPatch(typeof(InputManager))] private class InputManager_Block_Patch { [HarmonyPrefix] [HarmonyPatch("KeyDown")] private static bool PrefixKeyDown(ref bool __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = false; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("KeyUp")] private static bool PrefixKeyUp(ref bool __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = false; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("KeyHold")] private static bool PrefixKeyHold(ref bool __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = false; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("GetMovementX")] private static bool PrefixGetMovementX(ref float __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = 0f; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("GetMovementY")] private static bool PrefixGetMovementY(ref float __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = 0f; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("GetScrollY")] private static bool PrefixGetScrollY(ref float __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = 0f; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("KeyPullAndPush")] private static bool PrefixKeyPullAndPush(ref float __result) { if (IsStaticModEnabled() && IsWindowOpen()) { __result = 0f; return false; } return true; } } internal class DetectorCache { public float LastCheckTime; public bool IsValuable; public bool IsBead; public bool IsWeapon; public bool IsVehicle; public bool IsCosmetic; public bool IsPotion; public bool IsBattery; } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Update")] private class PhysGrabObjectImpactDetector_Update_Patch { [HarmonyPostfix] private static void Postfix(PhysGrabObjectImpactDetector __instance) { if (!IsStaticModEnabled()) { return; } float time = Time.time; if (_detectorCache.TryGetValue(__instance, out var value)) { if (time - value.LastCheckTime < 0.5f) { return; } value.LastCheckTime = time; } ApplyGodModeForDetector(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Start")] private class PhysGrabObjectImpactDetector_Start_Patch { [HarmonyPostfix] private static void Postfix(PhysGrabObjectImpactDetector __instance) { ApplyGodModeForDetector(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] private class PhysGrabObjectImpactDetector_Break_Patch { [HarmonyPrefix] private static void Prefix(PhysGrabObjectImpactDetector __instance) { ApplyGodModeForDetector(__instance); } } internal sealed class LiveLabel { public WeakReference Tmp; public CfgI18N I18N; public bool IsSection; } internal sealed class LiveValue { public WeakReference InputField; public CfgI18N I18N; } internal sealed class LiveSliderOptions { public WeakReference Slider; public CfgI18N I18N; public string[] OptionsCN; public string[] OptionsEN; } internal sealed class LiveToggleButtons { public WeakReference LeftTmp; public WeakReference RightTmp; } public const string PluginGuid = "zichen.gametools"; public const string PluginName = "GameTools"; public const string PluginVersion = "1.0.9"; internal static Plugin Instance; internal static Vector3 _lastRemoteTpPos = Vector3.zero; internal static float _lastRemoteTpTime = 0f; private Harmony _harmony; internal static readonly FieldRef PlayerSteamIDRef = AccessTools.FieldRefAccess("playerSteamID"); internal static readonly FieldRef PlayerAvatarSteamIDRef = AccessTools.FieldRefAccess("steamID"); internal static readonly FieldRef PlayerAvatarIsLocalRef = AccessTools.FieldRefAccess("isLocal"); internal static readonly FieldRef PlayerAvatarPlayerNameRef = AccessTools.FieldRefAccess("playerName"); internal static readonly FieldRef PlayerAvatarDeadSetRef = AccessTools.FieldRefAccess("deadSet"); internal static readonly FieldRef PlayerAvatarTumbleRef = AccessTools.FieldRefAccess("tumble"); internal static readonly FieldRef PlayerAvatarUpgradeTumbleWingsRef = AccessTools.FieldRefAccess("upgradeTumbleWings"); internal static readonly FieldRef PlayerAvatarUpgradeTumbleWingsVisualsActiveRef = AccessTools.FieldRefAccess("upgradeTumbleWingsVisualsActive"); internal static readonly FieldRef PlayerAvatarPlayerDeathHeadRef = AccessTools.FieldRefAccess("playerDeathHead"); internal static readonly FieldRef PlayerDeathHeadPhysGrabObjectRef = AccessTools.FieldRefAccess("physGrabObject"); internal static readonly FieldRef Wing1MeshRendererRef = AccessTools.FieldRefAccess("wing1MeshRenderer"); internal static readonly FieldRef Wing2MeshRendererRef = AccessTools.FieldRefAccess("wing2MeshRenderer"); internal static readonly FieldRef WingsPlayerTumbleRef = AccessTools.FieldRefAccess("playerTumble"); internal static readonly FieldRef TumbleWingTimerRef = AccessTools.FieldRefAccess("tumbleWingTimer"); internal static readonly FieldRef TumbleWingPinkTimerRef = AccessTools.FieldRefAccess("tumbleWingPinkTimer"); internal static readonly FieldRef WingsIsPinkRef = AccessTools.FieldRefAccess("isPink"); internal static readonly FieldRef> ItemsInCartRef = AccessTools.FieldRefAccess>("itemsInCart"); internal static readonly FieldRef ItemsInCartCountRef = AccessTools.FieldRefAccess("itemsInCartCount"); internal static readonly FieldRef PlayerTumblePhysGrabObjectRef = AccessTools.FieldRefAccess("physGrabObject"); internal static readonly FieldRef PlayerTumbleIsTumblingRef = AccessTools.FieldRefAccess("isTumbling"); internal static readonly FieldRef EnemyParentSetupDoneRef = AccessTools.FieldRefAccess("SetupDone"); internal static readonly FieldRef EnemyParentFirstSpawnPointUsedRef = AccessTools.FieldRefAccess("firstSpawnPointUsed"); internal static readonly FieldRef EnemyDirectorSpawnIdlePauseTimerRef = AccessTools.FieldRefAccess("spawnIdlePauseTimer"); internal static readonly FieldRef EnemyParentSpawnedRef = AccessTools.FieldRefAccess("Spawned"); internal static readonly FieldRef EnemyParentPlayerCloseRef = AccessTools.FieldRefAccess("playerClose"); internal static readonly FieldRef EnemyParentEnemyRef = AccessTools.FieldRefAccess("Enemy"); internal static readonly FieldRef> EnemyDirectorEnemyValuablesRef = AccessTools.FieldRefAccess>("enemyValuables"); internal static readonly FieldRef EnemyParentValuableSpawnTimerRef = AccessTools.FieldRefAccess("valuableSpawnTimer"); internal static readonly FieldRef EnemyHealthRef = AccessTools.FieldRefAccess("Health"); internal static readonly FieldRef EnemyHasHealthRef = AccessTools.FieldRefAccess("HasHealth"); internal static readonly FieldRef EnemyHealthSpawnValuableCurrentRef = AccessTools.FieldRefAccess("spawnValuableCurrent"); internal static readonly FieldRef EnemyHealthCurrentRef = AccessTools.FieldRefAccess("healthCurrent"); internal static readonly FieldRef PlayerHealthCurrentRef = AccessTools.FieldRefAccess("health"); internal static readonly FieldRef PlayerHealthMaxRef = AccessTools.FieldRefAccess("maxHealth"); internal static readonly FieldRef PlayerHealthAvatarRef = AccessTools.FieldRefAccess("playerAvatar"); internal static readonly FieldRef CursorManagerUnlockTimerRef = AccessTools.FieldRefAccess("unlockTimer"); internal static readonly FieldRef RunManagerLevelIsShopRef = AccessTools.FieldRefAccess("levelIsShop"); internal static readonly FieldRef EnemyNavMeshAgentAgentRef = AccessTools.FieldRefAccess("Agent"); internal static readonly FieldRef EnemyHasRigidbodyRef = AccessTools.FieldRefAccess("HasRigidbody"); internal static readonly FieldRef EnemyRigidbodyRef = AccessTools.FieldRefAccess("Rigidbody"); internal static readonly FieldRef EnemyRigidbodyRbRef = AccessTools.FieldRefAccess("rb"); internal static readonly FieldRef EnemyRigidbodyFollowTargetRef = AccessTools.FieldRefAccess("followTarget"); internal static readonly FieldRef EnemyRigidbodyPhysGrabObjectRef = AccessTools.FieldRefAccess("physGrabObject"); internal static readonly FieldRef EnemyDirectorAmountCurve1ValueRef = AccessTools.FieldRefAccess("amountCurve1Value"); internal static readonly FieldRef EnemyDirectorAmountCurve2ValueRef = AccessTools.FieldRefAccess("amountCurve2Value"); internal static readonly FieldRef EnemyDirectorAmountCurve3ValueRef = AccessTools.FieldRefAccess("amountCurve3Value"); internal static readonly FieldRef EnemyDirectorTotalAmountRef = AccessTools.FieldRefAccess("totalAmount"); internal static readonly FieldRef PlayerAvatarVisualsRightArmRef = AccessTools.FieldRefAccess("playerAvatarRightArm"); internal static readonly FieldRef CameraPositionOverridePositionActiveRef = AccessTools.FieldRefAccess("overridePositionActive"); internal static readonly FieldRef CameraPositionOverridePositionTimerRef = AccessTools.FieldRefAccess("overridePositionTimer"); internal static readonly FieldRef ValuablePhysGrabObjectRef = AccessTools.FieldRefAccess("physGrabObject"); internal static readonly FieldRef DetectorIsIndestructibleRef = AccessTools.FieldRefAccess("isIndestructible"); internal static readonly FieldRef ExtractionPointCurrentStateRef = AccessTools.FieldRefAccess("currentState"); internal static readonly FieldRef ExtractionPointIsShopRef = AccessTools.FieldRefAccess("isShop"); internal static readonly FieldRef CosmeticWorldObjectInExtractionRef = AccessTools.FieldRefAccess("inExtraction"); internal static readonly FieldRef> RoundDirectorCosmeticWorldObjectsExtractedRef = AccessTools.FieldRefAccess>("cosmeticWorldObjectsExtracted"); internal static readonly FieldRef ItemEquippableIsEquippedRef = AccessTools.FieldRefAccess("isEquipped"); internal static readonly FieldRef PhysGrabCartPhysGrabObjectRef = AccessTools.FieldRefAccess("physGrabObject"); internal static readonly FieldRef PhysGrabInCartInCartObjectsRef = AccessTools.FieldRefAccess("inCartObjects"); internal static readonly FieldRef ItemBatteryBatteryLifeIntRef = AccessTools.FieldRefAccess("batteryLifeInt"); private static FieldInfo _cartObjectPhysGrabField = null; private bool _windowOpen; private int _currentTab; private bool _itemTeleportValuable = true; private bool _itemTeleportBead = true; private bool _itemTeleportWeapon; private bool _itemTeleportVehicle; private bool _itemTeleportCosmetic = true; private bool _itemTeleportPotion = true; private bool _itemTeleportHealPack = true; private bool _itemTeleportBattery = true; private bool _itemTeleportMoneyBag = true; private float _itemTeleportCountSlider = 11f; private float _itemTeleportInterval = 0.3f; private bool _isTeleporting; private bool _cancelTeleportRequested; private int _activeTeleportCoroutines; private bool _itemExcludeTruckAndExtraction = true; private int _teleportTotalCount; private int _teleportCurrentIndex; private string _teleportStatusText = ""; private CursorLockMode _prevLockMode; private bool _prevVisible; internal static int _realUpgradeHealth = -1; internal static int _realUpgradeStamina = -1; internal static int _realUpgradeSpeed = -1; private static ConfigFile _runtimeConfig; internal static ConfigEntry _cfgModEnabled; private static ConfigEntry _cfgProhibitOthers; private static ConfigEntry _cfgLanguage; internal static ConfigEntry _cfgEnableHKeyHotkey; internal static ConfigEntry _cfgEnableGKeyHotkey; private ConfigEntry _openKey; private static ConfigEntry _cfgWingsAlwaysShow; private static ConfigEntry _cfgEnableWingsSound; private static ConfigEntry _cfgJumpMultiplierEnabled; private static ConfigEntry _cfgJumpMultiplier; private static ConfigEntry _cfgInfiniteStamina; private static ConfigEntry _cfgTumbleFlyEnabled; private static ConfigEntry _cfgInfiniteWeaponBattery; private static ConfigEntry _cfgInfiniteChargingStation; private static ConfigEntry _cfgChargingStationHeal; internal static ConfigEntry _cfgInfBatteryMelee; internal static ConfigEntry _cfgInfBatteryRanged; internal static ConfigEntry _cfgInfBatteryVehicles; internal static ConfigEntry _cfgInfBatteryDrones; internal static ConfigEntry _cfgInfBatteryTools; private static ConfigEntry _cfgSpawnRateMultiplier; internal static ConfigEntry _cfgEnemyPullInterval; internal static ConfigEntry _cfgEnemyPullDistance; internal static ConfigEntry _cfgSpawnDistance; private static ConfigEntry _cfgRemovePillarLimit; private static ConfigEntry _cfgPillarDropMultiplierEnabled; private static ConfigEntry _cfgTeammateDeathDropBead; private static ConfigEntry _cfgTeammateReviveDropBead; private static ConfigEntry _cfgPillarDropMultiplier; internal static ConfigEntry _cfgLimitCosmeticBoxes; private static ConfigEntry _cfgLimitCosmeticBoxesValue; private static ConfigEntry _cfgAutoReviveTeammates; private static ConfigEntry _cfgAutoReviveWhenSeen; private static ConfigEntry _cfgReviveHeadOnTruck; private static ConfigEntry _cfgReviveHeadOnExtraction; private static ConfigEntry _cfgReviveHeadOnCart; private static ConfigEntry _cfgReviveAutoToTruck; private static ConfigEntry _cfgDeathAutoToTruck; private static ConfigEntry _cfgDeathAutoToExtraction; private static ConfigEntry _cfgLimitActionAndOvercharge; internal static ConfigEntry _cfgResetMonsterDataOnLevelLoad; private static ConfigEntry _cfgWingsColorIndex; private static ConfigEntry _cfgWingsShowFrequency; private static ConfigEntry _cfgThirdPersonEnabled; private static ConfigEntry _cfgThirdPersonDistance; private static ConfigEntry _cfgThirdPersonHeight; private static ConfigEntry _cfgThirdPersonModelScale; internal static ConfigEntry _cfgThirdPersonHorizontal; private static ConfigEntry _cfgGodModeFlightEnabled; private static ConfigEntry _cfgAllTeammatesGodMode; internal static ConfigEntry _cfgValuableGodMode; internal static ConfigEntry _cfgValuableGodModeBead; internal static ConfigEntry _cfgValuableGodModeWeapon; internal static ConfigEntry _cfgValuableGodModeVehicle; internal static ConfigEntry _cfgValuableGodModeCosmetic; internal static ConfigEntry _cfgValuableGodModePotion; internal static ConfigEntry _cfgValuableGodModeHealPack; internal static ConfigEntry _cfgValuableGodModeBattery; internal static ConfigEntry _cfgValuableGodModeMoneyBag; private static readonly HashSet _processedGodModeTeammates = new HashSet(); private static readonly Dictionary _teammateDeathTimers = new Dictionary(); private static readonly HashSet _localGodModePlayers = new HashSet(); private static readonly HashSet _tempGodModePlayers = new HashSet(); private static readonly HashSet _flightGodModePlayers = new HashSet(); private static bool _gKeyWasPressed = false; private static bool _hKeyWasPressed = false; private static float _lastAllTeammatesGodCheckTime = 0f; private float _lastAutoReviveCheckTime; private static ConfigEntry _cfgTab0Enabled; private static ConfigEntry _cfgTab1Enabled; private static ConfigEntry _cfgTab2Enabled; private static ConfigEntry _cfgTab3Enabled; private static ConfigEntry _cfgTab4Enabled; private static ConfigEntry _cfgTab5Enabled; private static ConfigEntry _cfgTab6Enabled; internal static readonly Dictionary _enemyScaleDict = new Dictionary(); internal static EnemyScaleSync _enemyScaleSync; internal static ConfigEntry _cfgCosmeticsEnabled; internal static ConfigEntry _cfgFlipEnabled; internal static ConfigEntry _cfgFlipShowToSelf; internal static ConfigEntry _cfgEyeEffectEnabled; internal static ConfigEntry _cfgEyeEffect; internal static ConfigEntry _cfgEyeBigPupil; internal static ConfigEntry _cfgEyePupilScaleAuto; internal static ConfigEntry _cfgEyePupilScaleSpeed; internal static ConfigEntry _cfgEyeColorMode; internal static ConfigEntry _cfgEyeSingleColor; internal static ConfigEntry _cfgEyeMultiSelectRed; internal static ConfigEntry _cfgEyeMultiSelectGreen; internal static ConfigEntry _cfgEyeMultiSelectOrange; internal static ConfigEntry _cfgEyeMultiSelectLove; internal static ConfigEntry _cfgEyeMultiSelectInverted; internal static ConfigEntry _cfgEyeSwapInterval; internal static ConfigEntry _cfgFlashlightColorEnabled; internal static ConfigEntry _cfgFlashlightColor; internal static ConfigEntry _cfgSpinEnabled; internal static ConfigEntry _cfgSpinDirection; internal static ConfigEntry _cfgSpinSpeed; internal static ConfigEntry _cfgSpinShowToSelf; internal static ConfigEntry _cfgSpinFreeze; internal static ConfigEntry _cfgSpinAxis; internal static ConfigEntry _cfgSpinRadius; public static int CurrentEyeColor = 2; private static float _eyeSwapTimer = 0f; internal static float _spinAngle = 0f; private static bool _cachedIsProhibitedByHost = false; private static float _lastProhibitCheckTime = 0f; private static readonly Dictionary _chargingStationHealTimers = new Dictionary(); private static bool _wasInRoom = false; private static int _localUpgradeSyncVersion = 0; private static readonly Dictionary _teammateSyncVersions = new Dictionary(); private static float _lastHostUpgradeCheckTime = 0f; public static ConfigEntry _cfgUpgradeLimitEnabled; public static readonly Dictionary> _cfgLimitToggles = new Dictionary>(); public static readonly Dictionary> _cfgLimitValues = new Dictionary>(); public static readonly string[] UpgradeTypes = new string[13] { "Speed", "Stamina", "Health", "ExtraJump", "TumbleWings", "CrouchRest", "DeathHeadBattery", "Launch", "MapPlayerCount", "Range", "Strength", "Throw", "TumbleClimb" }; public static readonly string[] UpgradeNamesCN = new string[13] { "奔跑速度", "体力上限", "生命上限", "额外跳跃", "滑翔翅膀", "蹲下休息", "复活电池", "大扑起跳", "终端雷达", "抓取距离", "抓取力量", "丢物力量", "攀爬速度" }; public static readonly string[] UpgradeNamesEN = new string[13] { "Sprint Speed", "Stamina Up", "Health Up", "Extra Jump", "Glide Wings", "Crouch Rest", "Revive Battery", "Leap Boost", "Scanner Count", "Grab Range", "Grab Strength", "Throw Force", "Climb Speed" }; public static readonly Dictionary _uiLevelsBuffer = new Dictionary(); public static readonly Dictionary _uiLimitTogglesBuffer = new Dictionary(); public static readonly Dictionary _uiLimitValuesBuffer = new Dictionary(); public static int _lastTab = -1; private static string _cachedLocalSteamID = ""; private static float _lastSteamIDCheckTime = 0f; internal static readonly ConditionalWeakTable _batteryCache = new ConditionalWeakTable(); private static Camera _cachedMainCamera; public static readonly Color[] WingsColors = (Color[])(object)new Color[2] { new Color(1f, 0.4f, 0.7f), new Color(0.15f, 0.3f, 1f) }; private float _masterCheckTimer; private static readonly string[] _chineseModKeywords = new string[6] { "chinese", "简体", "繁體", "繁体", "汉化", "中文" }; private static readonly string[] _chineseEnvironmentPluginGuids = new string[1] { "gravydevsupreme.xunity.autotranslator" }; internal static readonly Dictionary _cfgByEnSection = new Dictionary(StringComparer.Ordinal); internal static readonly Dictionary _cfgByEnKey = new Dictionary(StringComparer.Ordinal); internal static readonly Dictionary> _cfgByKeyOnly = new Dictionary>(StringComparer.Ordinal); private static readonly List _cfgI18Ns = new List(20); internal static GameObject _tempLevelGenGo; internal static GameObject _tempEnemyDirGo; private static readonly Dictionary _chineseNames = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "Oogly", "哭泣鬼 (Oogly)" }, { "Tick", "蜱虫 (Tick)" }, { "ThinMan", "瘦子触手怪 (Thin Man)" }, { "HeartHugger", "抱心怪 (Heart Hugger)" }, { "Floater", "漂浮者 (Floater)" }, { "Runner", "奔跑者 (Runner)" }, { "Slow Walker", "慢行者 (Slow Walker)" }, { "Gnome", "地精 (Gnome)" }, { "Beamer", "激光怪 (Beamer)" }, { "Bomb Thrower", "投弹者 (Bomb Thrower)" }, { "Valuable Thrower", "丢垃圾者 (Valuable Thrower)" }, { "Slow Mouth", "大嘴怪 (Slow Mouth)" }, { "Upscream", "尖叫怪 (Upscream)" }, { "Tricycle", "三轮车 (Tricycle)" }, { "Bang", "炸弹人 (Bang)" }, { "Head Grabber", "抱头怪 (Head Grabber)" }, { "Gun Tranq", "麻醉枪" }, { "Gun Laser", "激光枪" }, { "Mine Explosive", "爆炸地雷" }, { "Mine Stun", "电击地雷" }, { "Grenade Stun", "闪光眩晕弹" }, { "Grenade Explosive", "爆炸手雷" }, { "Grenade Shockwave", "冲击波弹" }, { "Grenade Human", "诱饵弹" }, { "Grenade Duct Taped", "胶带手雷" }, { "Melee Inflatable Hammer", "充气气锤" }, { "Stun Baton", "电击棒" }, { "Staff Void", "虚空法杖" }, { "Staff Torque", "扭矩法杖" }, { "Staff Zero Gravity", "无重力法杖" }, { "Gumball", "扭蛋机" }, { "Surplus Small", "剩余物资(小)" }, { "Surplus Medium", "剩余物资(中)" }, { "Surplus Big", "剩余物资(大)" }, { "MoneyBag", "钱袋" }, { "Milk", "牛奶瓶" }, { "Barrel", "木桶" }, { "Jackhammer", "冲击钻" }, { "FireExtinguisher", "灭火器" }, { "Flamethrower", "火焰喷射器" }, { "IceSaw", "电锯/冰锯" }, { "Blender", "榨汁机" }, { "CrystalBall", "水晶球" }, { "BabyHead", "婴儿头" }, { "Vehicle Semiscooter Small", "小型滑板车 (Scooter)" }, { "Vehicle Cart Small", "小型手推车 (Cart S)" }, { "Vehicle Cart Medium", "中型手推车 (Cart M)" }, { "Vehicle Cart Big", "大型手推车 (Cart L)" }, { "Vehicle Cart Pallet", "液压托盘车 (Pallet)" }, { "Pocket Cart", "折叠随身车" } }; private static int _currentSubTab = 0; private static int _monsterSubTab = 0; internal static float _globalDespawnMin = 30f; internal static float _globalDespawnMax = 120f; internal static float _globalSpawnMin = 60f; internal static float _globalSpawnMax = 300f; internal static float _originalDespawnMin = 30f; internal static float _originalDespawnMax = 120f; internal static float _originalSpawnMin = 60f; internal static float _originalSpawnMax = 300f; internal static bool _globalOverrideInited = false; private static Vector2 _subScrollPos = Vector2.zero; private static Vector2 _playerScrollPos = Vector2.zero; private static int _spawnCount = 1; internal static bool _cfgSpawnedAutoRespawn = false; internal static bool _cfgSpawnedDelayPull = true; private static List _spawnablesValuables = new List(); private static List _spawnablesMelee = new List(); private static List _spawnablesRanged = new List(); private static List _spawnablesOtherWeapons = new List(); private static List _spawnablesEnemies = new List(); private static List _spawnablesCarts = new List(); private static List _spawnablesVehicles = new List(); private static List _spawnablesPotions = new List(); private static List _spawnablesOthers = new List(); private static List _spawnablesDrones = new List(); private static List _spawnablesCustomItems = new List(); private static List _spawnablesCustomEnemies = new List(); private static List _spawnablesCosmeticBoxes = new List(); private static bool _spawnablesLoaded = false; private static List _cachedCosmeticObjectSetups = new List(); private static readonly HashSet _teleportedObjectIds = new HashSet(); internal static readonly string[] AvailableKeybinds = new string[55] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "Space", "Enter", "Tab", "LeftShift", "RightShift", "LeftControl", "RightControl" }; private const int OpenInputKeyValue = 336; private static readonly InputKey OpenInputKey = (InputKey)336; private static string _lastAppliedOpenKey; private static KeyControl _cachedOpenKeyControl; private static string _cachedOpenKeyControlName; private const int GuiWindowId = 33002; private const float Pad = 16f; private static readonly ConditionalWeakTable _enemyNameCacheCN = new ConditionalWeakTable(); private static readonly ConditionalWeakTable _enemyNameCacheEN = new ConditionalWeakTable(); private Rect _windowRect = new Rect(0f, 0f, 1150f, 900f); private bool _windowCentered; private Vector2 _scrollPos = Vector2.zero; private bool _showConfirmSpawn; private SpawnableInfo _pendingSpawnInfo; private float _lastVirtualHeight = 400f; private string _spawnCountStr; private List _cachedExtractionPoints = new List(); private float _lastExtractionPointRefreshTime; private bool _showConfirmKillAllTeammates; private bool _stylesInit; private Texture2D _texDark; private Texture2D _texMid; private Texture2D _texLight; private Texture2D _texGreen; private Texture2D _texRed; private Texture2D _texSection; private Texture2D _texBorder; private Texture2D _texMask; private GUIStyle _sWindow; private GUIStyle _sTitle; private GUIStyle _sLabel; private GUIStyle _sStatus; private GUIStyle _sBtnGreen; private GUIStyle _sBtnRed; private GUIStyle _sBtnNormal; private GUIStyle _sBtnClose; private GUIStyle _sSection; private GUIStyle _sToggleOn; private GUIStyle _sCheckmarkStyleWhite; private GUIStyle _sSlider; private GUIStyle _sThumb; private GUIStyle _sTextInput; private GUIStyle _sCenteredLabel; private GUIStyle _sWarningStyle; private GUIStyle _sLabelLarge; private GUIStyle _sHeaderStyle; private GUIStyle _sInputStyleLarge; private GUIStyle _sToggleStyleLarge; private GUIStyle _sQuickBtnStyle; private GUIStyle _sLabelEpComplete; private GUIStyle _sLabelEpLocked; private GUIStyle _sLabelEpUnlocked; private GUIStyle _sMsgStyle; private static Dictionary _originalWingsLevel = new Dictionary(); internal static readonly ConditionalWeakTable _detectorCache = new ConditionalWeakTable(); private static readonly List _liveLabels = new List(32); private static readonly List _liveValues = new List(4); private static readonly List _liveSliderOptions = new List(4); private static readonly List _liveToggleButtons = new List(8); private static readonly Dictionary _labelTmpFieldCache = new Dictionary(8); private static readonly Dictionary _sliderStringOptionsPropCache = new Dictionary(4); private static readonly Dictionary _toggleLeftTmpCache = new Dictionary(4); private static readonly Dictionary _toggleRightTmpCache = new Dictionary(4); private static readonly Dictionary _pendingKeyMatchIndex = new Dictionary(StringComparer.Ordinal); internal static string _currentRenderingConfigFilePath; internal static bool _createModEntriesPatchInstalled; private static readonly Dictionary _inputStringSystemFieldCache = new Dictionary(4); private static readonly Dictionary _inputStringSystemSetValueCache = new Dictionary(4); private static readonly Dictionary _enumNameCNtoEN = new Dictionary(StringComparer.Ordinal) { ["中文"] = "Chinese" }; private static readonly Dictionary _enumNameENtoCN = new Dictionary(StringComparer.Ordinal) { ["English"] = "英语", ["Chinese"] = "中文" }; public static bool IsWindowOpen() { if ((Object)(object)Instance != (Object)null) { return Instance._windowOpen; } return false; } public void StartTeleportJob() { _activeTeleportCoroutines++; _isTeleporting = true; ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[GameTools] StartTeleportJob: activeCoroutines={_activeTeleportCoroutines}, isTeleporting={_isTeleporting}"); } public void EndTeleportJob() { _activeTeleportCoroutines--; if (_activeTeleportCoroutines <= 0) { _activeTeleportCoroutines = 0; _isTeleporting = false; } ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[GameTools] EndTeleportJob: activeCoroutines={_activeTeleportCoroutines}, isTeleporting={_isTeleporting}"); } public static void CancelTeleportOperation() { if ((Object)(object)Instance != (Object)null && Instance._isTeleporting) { Instance._cancelTeleportRequested = true; Instance._teleportStatusText = (UseChinese() ? "取消传送中..." : "Cancelling..."); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)"[GameTools] User requested to cancel teleportation."); } } public static bool IsProhibitedByHost() { float time = Time.time; if (time - _lastProhibitCheckTime >= 1f) { _lastProhibitCheckTime = time; _cachedIsProhibitedByHost = CheckIsProhibitedByHostRaw(); } return _cachedIsProhibitedByHost; } private static bool CheckIsProhibitedByHostRaw() { try { if (PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null && !PhotonNetwork.IsMasterClient && PhotonNetwork.MasterClient != null && ((Dictionary)(object)PhotonNetwork.MasterClient.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value && ((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)"GT_ProhibitOthers", out object value2) && value2 is bool && (bool)value2) { return true; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[IsProhibitedByHost Error]: {arg}"); } } return false; } public static int SafeConvertToInt(object obj, int defaultValue = 0) { if (obj == null) { return defaultValue; } try { return Convert.ToInt32(obj); } catch { return defaultValue; } } public static bool IsStaticModEnabled() { if (_cfgModEnabled == null || !_cfgModEnabled.Value) { return false; } if (IsProhibitedByHost()) { return false; } return true; } public static bool IsTab0Enabled() { if (IsStaticModEnabled()) { if (_cfgTab0Enabled != null) { return _cfgTab0Enabled.Value; } return true; } return false; } public static bool IsTab1Enabled() { if (IsStaticModEnabled()) { if (_cfgTab1Enabled != null) { return _cfgTab1Enabled.Value; } return true; } return false; } public static bool IsTab2Enabled() { if (IsStaticModEnabled()) { if (_cfgTab2Enabled != null) { return _cfgTab2Enabled.Value; } return true; } return false; } public static bool IsTab3Enabled() { if (IsStaticModEnabled()) { if (_cfgTab3Enabled != null) { return _cfgTab3Enabled.Value; } return true; } return false; } public static bool IsTab4Enabled() { if (IsStaticModEnabled()) { if (_cfgTab4Enabled != null) { return _cfgTab4Enabled.Value; } return true; } return false; } public static bool IsTab5Enabled() { if (IsStaticModEnabled()) { if (_cfgTab5Enabled != null) { return _cfgTab5Enabled.Value; } return true; } return false; } public static bool IsTab6Enabled() { if (IsStaticModEnabled()) { if (_cfgTab6Enabled != null) { return _cfgTab6Enabled.Value; } return true; } return false; } public static bool IsValuableGodModeValuableEnabled() { if (IsTab2Enabled() && _cfgValuableGodMode != null) { return _cfgValuableGodMode.Value; } return false; } public static bool IsValuableGodModeBeadEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeBead != null) { return _cfgValuableGodModeBead.Value; } return false; } public static bool IsValuableGodModeWeaponEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeWeapon != null) { return _cfgValuableGodModeWeapon.Value; } return false; } public static bool IsValuableGodModeVehicleEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeVehicle != null) { return _cfgValuableGodModeVehicle.Value; } return false; } public static bool IsValuableGodModeCosmeticEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeCosmetic != null) { return _cfgValuableGodModeCosmetic.Value; } return false; } public static bool IsValuableGodModePotionEnabled() { if (IsTab2Enabled() && _cfgValuableGodModePotion != null) { return _cfgValuableGodModePotion.Value; } return false; } public static bool IsValuableGodModeHealPackEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeHealPack != null) { return _cfgValuableGodModeHealPack.Value; } return false; } public static bool IsValuableGodModeBatteryEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeBattery != null) { return _cfgValuableGodModeBattery.Value; } return false; } public static bool IsValuableGodModeMoneyBagEnabled() { if (IsTab2Enabled() && _cfgValuableGodModeMoneyBag != null) { return _cfgValuableGodModeMoneyBag.Value; } return false; } public static bool IsValuableGodModeEnabled() { if (!IsValuableGodModeValuableEnabled() && !IsValuableGodModeBeadEnabled() && !IsValuableGodModeWeaponEnabled() && !IsValuableGodModeVehicleEnabled() && !IsValuableGodModeCosmeticEnabled() && !IsValuableGodModePotionEnabled() && !IsValuableGodModeHealPackEnabled() && !IsValuableGodModeBatteryEnabled()) { return IsValuableGodModeMoneyBagEnabled(); } return true; } public static bool IsCosmeticsEnabled() { if (_cfgModEnabled != null && _cfgModEnabled.Value && _cfgCosmeticsEnabled != null) { return _cfgCosmeticsEnabled.Value; } return false; } public static bool UseChinese() { if (_cfgLanguage != null) { return _cfgLanguage.Value == DisplayLanguage.中文; } return false; } public static bool IsWingsAlwaysShowEnabled() { if (IsCosmeticsEnabled() && _cfgWingsAlwaysShow != null) { return _cfgWingsAlwaysShow.Value; } return false; } public static bool IsWingsSoundEnabled() { if (IsCosmeticsEnabled()) { if (_cfgEnableWingsSound != null) { return _cfgEnableWingsSound.Value; } return true; } return false; } public static float GetSpawnRateMultiplier() { if (_cfgSpawnRateMultiplier == null || !IsTab5Enabled()) { return 1f; } return _cfgSpawnRateMultiplier.Value; } public static bool IsJumpMultiplierEnabled() { if (IsTab3Enabled() && _cfgJumpMultiplierEnabled != null) { return _cfgJumpMultiplierEnabled.Value; } return false; } public static float GetJumpMultiplier() { if (_cfgJumpMultiplier == null) { return 1f; } return _cfgJumpMultiplier.Value; } public static bool IsInfiniteStaminaEnabled() { if (_cfgModEnabled != null && _cfgModEnabled.Value && _cfgInfiniteStamina != null) { return _cfgInfiniteStamina.Value; } return false; } public static bool IsTumbleFlyEnabled() { if (IsTab3Enabled() && _cfgTumbleFlyEnabled != null) { return _cfgTumbleFlyEnabled.Value; } return false; } public static bool IsInfiniteWeaponBatteryEnabled() { if (IsTab3Enabled() && _cfgInfiniteWeaponBattery != null) { return _cfgInfiniteWeaponBattery.Value; } return false; } public static bool IsInfiniteChargingStationEnabled() { if (IsTab3Enabled() && _cfgInfiniteChargingStation != null) { return _cfgInfiniteChargingStation.Value; } return false; } public static bool IsChargingStationHealEnabled() { if (IsTab3Enabled() && _cfgChargingStationHeal != null) { return _cfgChargingStationHeal.Value; } return false; } private static bool TargetHasMod(PlayerAvatar avatar) { if ((Object)(object)avatar == (Object)null || (Object)(object)avatar.photonView == (Object)null || avatar.photonView.Owner == null) { return false; } if (((Dictionary)(object)avatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value) { return true; } return false; } public static void AccumulateChargingStationHeal(float deltaTime, ChargingStation station) { //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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00a3: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00ee: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)station == (Object)null) { return; } List list = SemiFunc.PlayerGetList(); if (list == null || list.Count == 0) { return; } Transform val = ((Component)station).transform.Find("Charge Area"); if ((Object)(object)val == (Object)null) { return; } foreach (PlayerAvatar item in list) { if ((Object)(object)item == (Object)null || PlayerAvatarDeadSetRef.Invoke(item) || (Object)(object)item.playerHealth == (Object)null) { continue; } Vector3 position = ((Component)item).transform.position; Vector3 val2 = val.InverseTransformPoint(position); bool flag = Mathf.Abs(val2.x) <= 0.6f && Mathf.Abs(val2.y) <= 0.6f && Mathf.Abs(val2.z) <= 0.6f; if (!flag) { Vector3 val3 = position + Vector3.up * 1f; Vector3 val4 = val.InverseTransformPoint(val3); flag = Mathf.Abs(val4.x) <= 0.6f && Mathf.Abs(val4.y) <= 0.6f && Mathf.Abs(val4.z) <= 0.6f; } if (!flag) { continue; } bool flag2 = PlayerAvatarIsLocalRef.Invoke(item); bool flag3 = SemiFunc.IsMasterClientOrSingleplayer(); bool flag4 = TargetHasMod(item); if (!flag2 && (!flag3 || flag4)) { continue; } string key = (((Object)(object)item.photonView != (Object)null && item.photonView.Owner != null) ? item.photonView.Owner.ActorNumber.ToString() : "local"); int num = PlayerHealthCurrentRef.Invoke(item.playerHealth); int num2 = PlayerHealthMaxRef.Invoke(item.playerHealth); if (num < num2) { if (!_chargingStationHealTimers.TryGetValue(key, out var value)) { value = 0f; } value += deltaTime; if (value >= 1f) { int num3 = Mathf.FloorToInt(value) * 5; value %= 1f; if (flag2) { item.playerHealth.Heal(num3, true); } else { item.playerHealth.HealOther(num3, true); } } _chargingStationHealTimers[key] = value; } else { _chargingStationHealTimers[key] = 0f; } } } public static void CheckJoinedRoomAndSync() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown bool flag = PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null; if (flag && !_wasInRoom) { _teammateSyncVersions.Clear(); _localUpgradeSyncVersion = 1; Hashtable val = new Hashtable(); val[(object)"GT_UP_VER"] = _localUpgradeSyncVersion; string cachedLocalSteamID = GetCachedLocalSteamID(); for (int i = 0; i < UpgradeTypes.Length; i++) { string text = UpgradeTypes[i]; int upgradeLevelFromGame = GetUpgradeLevelFromGame(text, cachedLocalSteamID); val[(object)("GT_UP_" + text)] = upgradeLevelFromGame; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } _wasInRoom = flag; } public static void HostReadTeammateCustomPropertiesUpgrades() { if (!PhotonNetwork.InRoom || !PhotonNetwork.IsMasterClient || Time.time - _lastHostUpgradeCheckTime < 2f) { return; } _lastHostUpgradeCheckTime = Time.time; List list = SemiFunc.PlayerGetList(); if (list == null) { return; } bool flag = false; foreach (PlayerAvatar item in list) { if ((Object)(object)item == (Object)null || PlayerAvatarIsLocalRef.Invoke(item) || (Object)(object)item.photonView == (Object)null || item.photonView.Owner == null) { continue; } string text = PlayerAvatarSteamIDRef.Invoke(item); if (string.IsNullOrEmpty(text)) { continue; } Player owner = item.photonView.Owner; if (!((Dictionary)(object)owner.CustomProperties).TryGetValue((object)"GT_UP_VER", out object value) || !(value is int num)) { continue; } _teammateSyncVersions.TryGetValue(text, out var value2); if (num <= value2) { continue; } for (int i = 0; i < UpgradeTypes.Length; i++) { string text2 = UpgradeTypes[i]; string key = "GT_UP_" + text2; if (((Dictionary)(object)owner.CustomProperties).TryGetValue((object)key, out object value3) && value3 is int num2) { int upgradeLevelFromGame = GetUpgradeLevelFromGame(text2, text); if (upgradeLevelFromGame != num2) { int delta = num2 - upgradeLevelFromGame; ApplyUpgradeDelta(text2, text, delta); flag = true; } } } _teammateSyncVersions[text] = num; } if (flag && (Object)(object)PunManager.instance != (Object)null) { PunManager.instance.SyncAllDictionaries(); } } public static string GetCachedLocalSteamID() { float time = Time.time; if (string.IsNullOrEmpty(_cachedLocalSteamID) || time - _lastSteamIDCheckTime >= 1f) { _lastSteamIDCheckTime = time; PlayerController instance = PlayerController.instance; object obj; if (instance == null) { obj = null; } else { PlayerAvatar playerAvatarScript = instance.playerAvatarScript; obj = ((playerAvatarScript != null) ? ((Component)playerAvatarScript).GetComponent() : null); } PlayerAvatar val = (PlayerAvatar)obj; _cachedLocalSteamID = (((Object)(object)val != (Object)null) ? PlayerAvatarSteamIDRef.Invoke(val) : ""); } return _cachedLocalSteamID; } public static bool IsUpgradeLimitEnabled() { if (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient) { return false; } if (IsTab6Enabled() && _cfgUpgradeLimitEnabled != null) { return _cfgUpgradeLimitEnabled.Value; } return false; } public static bool IsUpgradeLimitActiveFor(string type, string steamID, int currentVal, int valueToAdd) { if (valueToAdd <= 0) { return false; } if (!IsUpgradeLimitEnabled()) { return false; } string cachedLocalSteamID = GetCachedLocalSteamID(); if (!string.IsNullOrEmpty(steamID) && steamID != cachedLocalSteamID) { return false; } if (_cfgLimitToggles.TryGetValue(type, out var value) && value.Value && _cfgLimitValues.TryGetValue(type, out var value2) && currentVal + valueToAdd > value2.Value) { return true; } return false; } public static int GetUpgradeLevelFromGame(string type, string steamID) { if ((Object)(object)StatsManager.instance == (Object)null || string.IsNullOrEmpty(steamID)) { return 0; } return type switch { "Speed" => StatsManager.instance.playerUpgradeSpeed.GetValueOrDefault(steamID), "Stamina" => StatsManager.instance.playerUpgradeStamina.GetValueOrDefault(steamID), "Health" => StatsManager.instance.playerUpgradeHealth.GetValueOrDefault(steamID), "ExtraJump" => StatsManager.instance.playerUpgradeExtraJump.GetValueOrDefault(steamID), "TumbleWings" => StatsManager.instance.playerUpgradeTumbleWings.GetValueOrDefault(steamID), "CrouchRest" => StatsManager.instance.playerUpgradeCrouchRest.GetValueOrDefault(steamID), "DeathHeadBattery" => StatsManager.instance.playerUpgradeDeathHeadBattery.GetValueOrDefault(steamID), "Launch" => StatsManager.instance.playerUpgradeLaunch.GetValueOrDefault(steamID), "MapPlayerCount" => StatsManager.instance.playerUpgradeMapPlayerCount.GetValueOrDefault(steamID), "Range" => StatsManager.instance.playerUpgradeRange.GetValueOrDefault(steamID), "Strength" => StatsManager.instance.playerUpgradeStrength.GetValueOrDefault(steamID), "Throw" => StatsManager.instance.playerUpgradeThrow.GetValueOrDefault(steamID), "TumbleClimb" => StatsManager.instance.playerUpgradeTumbleClimb.GetValueOrDefault(steamID), _ => 0, }; } public static void ApplyUpgradeDelta(string type, string steamID, int delta) { if ((Object)(object)PunManager.instance == (Object)null || type == null) { return; } switch (type.Length) { case 5: switch (type[0]) { case 'S': if (type == "Speed") { PunManager.instance.UpgradePlayerSprintSpeed(steamID, delta); } break; case 'R': if (type == "Range") { PunManager.instance.UpgradePlayerGrabRange(steamID, delta); } break; case 'T': if (type == "Throw") { PunManager.instance.UpgradePlayerThrowStrength(steamID, delta); } break; } break; case 6: switch (type[0]) { case 'H': if (type == "Health") { PunManager.instance.UpgradePlayerHealth(steamID, delta); } break; case 'L': if (type == "Launch") { PunManager.instance.UpgradePlayerTumbleLaunch(steamID, delta); } break; } break; case 11: switch (type[6]) { case 'W': if (type == "TumbleWings") { PunManager.instance.UpgradePlayerTumbleWings(steamID, delta); } break; case 'C': if (type == "TumbleClimb") { PunManager.instance.UpgradePlayerTumbleClimb(steamID, delta); } break; } break; case 7: if (type == "Stamina") { PunManager.instance.UpgradePlayerEnergy(steamID, delta); } break; case 9: if (type == "ExtraJump") { PunManager.instance.UpgradePlayerExtraJump(steamID, delta); } break; case 10: if (type == "CrouchRest") { PunManager.instance.UpgradePlayerCrouchRest(steamID, delta); } break; case 16: if (type == "DeathHeadBattery") { PunManager.instance.UpgradeDeathHeadBattery(steamID, delta); } break; case 14: if (type == "MapPlayerCount") { PunManager.instance.UpgradeMapPlayerCount(steamID, delta); } break; case 8: if (type == "Strength") { PunManager.instance.UpgradePlayerGrabStrength(steamID, delta); } break; case 12: case 13: case 15: break; } } public static void RefreshUpgradeLevelsBuffer() { _uiLevelsBuffer.Clear(); _uiLimitTogglesBuffer.Clear(); _uiLimitValuesBuffer.Clear(); string cachedLocalSteamID = GetCachedLocalSteamID(); for (int i = 0; i < UpgradeTypes.Length; i++) { string text = UpgradeTypes[i]; int num = 0; if (!string.IsNullOrEmpty(cachedLocalSteamID)) { num = GetUpgradeLevelFromGame(text, cachedLocalSteamID); } _uiLevelsBuffer[text] = num.ToString(); if (_cfgLimitToggles.TryGetValue(text, out var value)) { _uiLimitTogglesBuffer[text] = value.Value; } else { _uiLimitTogglesBuffer[text] = false; } if (_cfgLimitValues.TryGetValue(text, out var value2)) { _uiLimitValuesBuffer[text] = value2.Value.ToString(); } else { _uiLimitValuesBuffer[text] = "5"; } } } public static void SaveUpgradeLevelsFromBuffer() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown string cachedLocalSteamID = GetCachedLocalSteamID(); if (!string.IsNullOrEmpty(cachedLocalSteamID) && (Object)(object)PunManager.instance != (Object)null) { for (int i = 0; i < UpgradeTypes.Length; i++) { string text = UpgradeTypes[i]; int result = 0; if (_uiLevelsBuffer.TryGetValue(text, out var value) && !string.IsNullOrEmpty(value)) { int.TryParse(value, out result); } result = Mathf.Max(0, result); if (_uiLimitTogglesBuffer.TryGetValue(text, out var value2) && value2 && _uiLimitValuesBuffer.TryGetValue(text, out var value3) && !string.IsNullOrEmpty(value3) && int.TryParse(value3, out var result2)) { result2 = Mathf.Max(0, result2); if (result > result2) { result = result2; _uiLevelsBuffer[text] = result.ToString(); } } int upgradeLevelFromGame = GetUpgradeLevelFromGame(text, cachedLocalSteamID); int num = result - upgradeLevelFromGame; if (num != 0) { ApplyUpgradeDelta(text, cachedLocalSteamID, num); } } } for (int j = 0; j < UpgradeTypes.Length; j++) { string key = UpgradeTypes[j]; if (_uiLimitTogglesBuffer.TryGetValue(key, out var value4) && _cfgLimitToggles.TryGetValue(key, out var value5)) { value5.Value = value4; } int result3 = 0; if (_uiLimitValuesBuffer.TryGetValue(key, out var value6) && !string.IsNullOrEmpty(value6)) { int.TryParse(value6, out result3); } result3 = Mathf.Max(0, result3); if (_cfgLimitValues.TryGetValue(key, out var value7)) { value7.Value = result3; } } if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { _localUpgradeSyncVersion++; Hashtable val = new Hashtable(); val[(object)"GT_UP_VER"] = _localUpgradeSyncVersion; for (int k = 0; k < UpgradeTypes.Length; k++) { string text2 = UpgradeTypes[k]; int result4 = 0; if (_uiLevelsBuffer.TryGetValue(text2, out var value8) && !string.IsNullOrEmpty(value8)) { int.TryParse(value8, out result4); } result4 = Mathf.Max(0, result4); val[(object)("GT_UP_" + text2)] = result4; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } SaveRuntimeConfig(); SemiFunc.StatSyncAll(); RefreshUpgradeLevelsBuffer(); } public static void ResetUpgradeSettings() { if (_cfgUpgradeLimitEnabled != null) { _cfgUpgradeLimitEnabled.Value = false; } string[] upgradeTypes = UpgradeTypes; foreach (string key in upgradeTypes) { if (_cfgLimitToggles.ContainsKey(key)) { _cfgLimitToggles[key].Value = false; } if (_cfgLimitValues.ContainsKey(key)) { _cfgLimitValues[key].Value = 5; } } SaveRuntimeConfig(); } public static string KeepOnlyDigits(string s) { if (string.IsNullOrEmpty(s)) { return ""; } StringBuilder stringBuilder = new StringBuilder(); foreach (char c in s) { if (char.IsDigit(c)) { stringBuilder.Append(c); } } return stringBuilder.ToString(); } public static bool IsBatteryInfiniteForType(itemType type) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected I4, but got Unknown if (!IsInfiniteWeaponBatteryEnabled()) { return false; } switch ((int)type) { case 7: if (_cfgInfBatteryMelee != null) { return _cfgInfBatteryMelee.Value; } return false; case 6: case 9: case 11: case 15: if (_cfgInfBatteryRanged != null) { return _cfgInfBatteryRanged.Value; } return false; case 2: case 12: case 14: if (_cfgInfBatteryVehicles != null) { return _cfgInfBatteryVehicles.Value; } return false; case 0: if (_cfgInfBatteryDrones != null) { return _cfgInfBatteryDrones.Value; } return false; default: if (_cfgInfBatteryTools != null) { return _cfgInfBatteryTools.Value; } return false; } } public static bool ShouldBatteryBeInfinite(ItemBattery battery) { //IL_00a2: 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_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)battery == (Object)null) { return false; } if (!IsInfiniteWeaponBatteryEnabled()) { return false; } if (!_batteryCache.TryGetValue(battery, out var value)) { value = new BatteryCache(); ItemAttributes val = ((Component)battery).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)battery).GetComponentInParent(); } if ((Object)(object)val == (Object)null) { val = ((Component)battery).GetComponentInChildren(); } if ((Object)(object)val != (Object)null && (Object)(object)val.item != (Object)null) { value.ItemType = val.item.itemType; value.Resolved = true; } else { value.FallbackResult = ResolveBatteryFallback(battery); } _batteryCache.Add(battery, value); } if (value.Resolved) { return IsBatteryInfiniteForType(value.ItemType); } return value.FallbackResult; } private static bool ResolveBatteryFallback(ItemBattery battery) { //IL_02f8: Unknown result type (might be due to invalid IL or missing references) try { Transform val = ((Component)battery).transform; while ((Object)(object)val != (Object)null) { string text = ((Object)val).name.ToLower(); if (text.Contains("melee") || text.Contains("shovel") || text.Contains("hammer") || text.Contains("bat")) { return _cfgInfBatteryMelee != null && _cfgInfBatteryMelee.Value; } if (text.Contains("gun") || text.Contains("weapon") || text.Contains("launcher") || text.Contains("pistol") || text.Contains("rifle") || text.Contains("shotgun") || text.Contains("taser") || text.Contains("cannon") || text.Contains("grenade") || text.Contains("mine")) { return _cfgInfBatteryRanged != null && _cfgInfBatteryRanged.Value; } if (text.Contains("vehicle") || text.Contains("cart") || text.Contains("truck") || text.Contains("car")) { return _cfgInfBatteryVehicles != null && _cfgInfBatteryVehicles.Value; } if (text.Contains("drone")) { return _cfgInfBatteryDrones != null && _cfgInfBatteryDrones.Value; } if (text.Contains("tool") || text.Contains("flashlight") || text.Contains("scanner") || text.Contains("tracker")) { return _cfgInfBatteryTools != null && _cfgInfBatteryTools.Value; } Component[] components = ((Component)val).GetComponents(); foreach (Component val2 in components) { if ((Object)(object)val2 == (Object)null) { continue; } Type type = ((object)val2).GetType(); PropertyInfo propertyInfo = type.GetProperty("item") ?? type.GetProperty("Item"); FieldInfo fieldInfo = type.GetField("item") ?? type.GetField("Item"); object obj = null; if (propertyInfo != null) { obj = propertyInfo.GetValue(val2, null); } else if (fieldInfo != null) { obj = fieldInfo.GetValue(val2); } if (obj != null) { FieldInfo fieldInfo2 = obj.GetType().GetField("itemType") ?? obj.GetType().GetField("ItemType"); PropertyInfo propertyInfo2 = obj.GetType().GetProperty("itemType") ?? obj.GetType().GetProperty("ItemType"); object obj2 = null; if (fieldInfo2 != null) { obj2 = fieldInfo2.GetValue(obj); } else if (propertyInfo2 != null) { obj2 = propertyInfo2.GetValue(obj, null); } if (obj2 != null && Enum.TryParse(obj2.ToString(), ignoreCase: true, out itemType result)) { return IsBatteryInfiniteForType(result); } } } val = val.parent; } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[ShouldBatteryBeInfinite Fallback Error]: {arg}"); } } if (_cfgInfBatteryTools != null) { return _cfgInfBatteryTools.Value; } return false; } public static bool IsRemovePillarLimitEnabled() { if (IsTab3Enabled() && _cfgRemovePillarLimit != null) { return _cfgRemovePillarLimit.Value; } return false; } public static bool IsPillarDropMultiplierEnabled() { if (IsTab3Enabled() && _cfgPillarDropMultiplierEnabled != null) { return _cfgPillarDropMultiplierEnabled.Value; } return false; } public static bool IsTeammateDeathDropBeadEnabled() { if (IsTab3Enabled() && _cfgTeammateDeathDropBead != null) { return _cfgTeammateDeathDropBead.Value; } return false; } public static bool IsTeammateReviveDropBeadEnabled() { if (IsTab3Enabled() && _cfgTeammateReviveDropBead != null) { return _cfgTeammateReviveDropBead.Value; } return false; } public static int GetPillarDropMultiplier() { if (_cfgPillarDropMultiplier == null) { return 1; } return _cfgPillarDropMultiplier.Value; } public static bool IsLimitCosmeticBoxesEnabled() { if (IsTab3Enabled() && _cfgLimitCosmeticBoxes != null) { return _cfgLimitCosmeticBoxes.Value; } return false; } public static int GetCosmeticBoxesLimit() { if (!IsTab3Enabled() || _cfgLimitCosmeticBoxesValue == null) { return 11; } return _cfgLimitCosmeticBoxesValue.Value; } public static bool IsAutoReviveTeammatesEnabled() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgAutoReviveTeammates != null) { return _cfgAutoReviveTeammates.Value; } return false; } public static bool IsAutoReviveWhenSeenEnabled() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgAutoReviveWhenSeen != null) { return _cfgAutoReviveWhenSeen.Value; } return false; } public static bool IsReviveHeadOnTruck() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgReviveHeadOnTruck != null) { return _cfgReviveHeadOnTruck.Value; } return false; } public static bool IsReviveHeadOnExtraction() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgReviveHeadOnExtraction != null) { return _cfgReviveHeadOnExtraction.Value; } return false; } public static bool IsReviveHeadOnCart() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgReviveHeadOnCart != null) { return _cfgReviveHeadOnCart.Value; } return false; } public static bool IsReviveAutoToTruck() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgReviveAutoToTruck != null) { return _cfgReviveAutoToTruck.Value; } return false; } public static bool IsDeathAutoToTruck() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgDeathAutoToTruck != null) { return _cfgDeathAutoToTruck.Value; } return false; } public static bool IsDeathAutoToExtraction() { if (IsTab1Enabled() && (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) && _cfgDeathAutoToExtraction != null) { return _cfgDeathAutoToExtraction.Value; } return false; } public static bool IsLimitActionAndOverchargeEnabled() { if (IsTab5Enabled() && _cfgLimitActionAndOvercharge != null) { return _cfgLimitActionAndOvercharge.Value; } return false; } public static int GetWingsColorIndex() { if (!IsCosmeticsEnabled() || _cfgWingsColorIndex == null) { return 0; } return _cfgWingsColorIndex.Value; } public static float GetWingsShowFrequency() { if (!IsCosmeticsEnabled() || _cfgWingsShowFrequency == null) { return 0f; } return _cfgWingsShowFrequency.Value; } public static bool IsTabMapPressed() { try { if ((Object)(object)Map.Instance != (Object)null && Map.Instance.Active) { return true; } } catch { } try { if (Keyboard.current != null && ((ButtonControl)Keyboard.current.tabKey).isPressed) { return true; } } catch { } return false; } public static bool IsThirdPersonEnabled() { if (!IsCosmeticsEnabled() || _cfgThirdPersonEnabled == null || !_cfgThirdPersonEnabled.Value) { return false; } if (IsTabMapPressed()) { return false; } return true; } public static float GetThirdPersonDistance() { if (!IsCosmeticsEnabled() || _cfgThirdPersonDistance == null) { return 2.2f; } return _cfgThirdPersonDistance.Value; } public static float GetThirdPersonHeight() { if (!IsCosmeticsEnabled() || _cfgThirdPersonHeight == null) { return 0.5f; } return _cfgThirdPersonHeight.Value; } public static float GetThirdPersonModelScale() { if (!IsCosmeticsEnabled() || _cfgThirdPersonModelScale == null) { return 0.8f; } return _cfgThirdPersonModelScale.Value; } public static float GetThirdPersonHorizontal() { if (!IsCosmeticsEnabled() || _cfgThirdPersonHorizontal == null) { return 0f; } return _cfgThirdPersonHorizontal.Value; } public static bool IsGodModeFlightEnabled() { if (IsTab3Enabled() && _cfgGodModeFlightEnabled != null) { return _cfgGodModeFlightEnabled.Value; } return false; } public static bool IsAllTeammatesGodModeEnabled() { if (IsTab1Enabled() && _cfgAllTeammatesGodMode != null) { return _cfgAllTeammatesGodMode.Value; } return false; } public static Camera GetMainCamera() { if ((Object)(object)_cachedMainCamera == (Object)null) { _cachedMainCamera = Camera.main; } return _cachedMainCamera; } public static bool IsPlayerManualGodMode(string steamID) { if (string.IsNullOrEmpty(steamID)) { return false; } return _localGodModePlayers.Contains(steamID); } public static bool IsPlayerGodMode(string steamID) { if (string.IsNullOrEmpty(steamID)) { return false; } if (IsPlayerFlightGodMode(steamID)) { return true; } if (IsGodModeFlightEnabled()) { string text = null; try { if ((Object)(object)PlayerController.instance != (Object)null) { text = PlayerSteamIDRef.Invoke(PlayerController.instance); } } catch { } if (!string.IsNullOrEmpty(text) && text == steamID) { return true; } } if (IsPlayerManualGodMode(steamID)) { return true; } if (PhotonNetwork.InRoom) { string key = "GT_God_" + steamID; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { if (val != null && ((Dictionary)(object)val.CustomProperties).TryGetValue((object)key, out object value) && value is bool && (bool)value) { return true; } } } return false; } public static bool IsPlayerTempGodMode(string steamID) { if (string.IsNullOrEmpty(steamID)) { return false; } return _tempGodModePlayers.Contains(steamID); } public static void SetPlayerTempGodMode(string steamID, bool enable) { if (!string.IsNullOrEmpty(steamID)) { if (enable) { _tempGodModePlayers.Add(steamID); } else { _tempGodModePlayers.Remove(steamID); } } } public static void SetPlayerFlightGodMode(string steamID, bool enable) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (string.IsNullOrEmpty(steamID)) { return; } if (!SemiFunc.IsMultiplayer()) { if (enable) { _flightGodModePlayers.Add(steamID); } else { _flightGodModePlayers.Remove(steamID); } } else if (PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null) { Hashtable val = new Hashtable(); val[(object)("GT_FlightGod_" + steamID)] = enable; PhotonNetwork.CurrentRoom.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } public static bool IsPlayerFlightGodMode(string steamID) { if (string.IsNullOrEmpty(steamID)) { return false; } if (!SemiFunc.IsMultiplayer()) { return _flightGodModePlayers.Contains(steamID); } if (PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null && ((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)("GT_FlightGod_" + steamID), out object value) && value is bool) { return (bool)value; } return false; } public static void SetPlayerGodMode(string steamID, bool enable) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (!IsStaticModEnabled() || string.IsNullOrEmpty(steamID)) { return; } if (enable) { _localGodModePlayers.Add(steamID); } else { _localGodModePlayers.Remove(steamID); } if (!PhotonNetwork.InRoom) { return; } string text = null; try { if ((Object)(object)PlayerController.instance != (Object)null) { text = PlayerSteamIDRef.Invoke(PlayerController.instance); } } catch { } if (steamID == text || PhotonNetwork.IsMasterClient) { Hashtable val = new Hashtable(); val[(object)("GT_God_" + steamID)] = enable; PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } public static void OnAllTeammatesGodModeChanged(bool enable) { _processedGodModeTeammates.Clear(); List list = SemiFunc.PlayerGetList(); if (list == null) { return; } foreach (PlayerAvatar item in list) { if ((Object)(object)item == (Object)null) { continue; } string text = PlayerAvatarSteamIDRef.Invoke(item); if (!string.IsNullOrEmpty(text)) { if (enable) { SetPlayerGodMode(text, enable: true); _processedGodModeTeammates.Add(text); } else { SetPlayerGodMode(text, enable: false); } } } } public static void UpdateAllTeammatesGodMode() { if (!IsAllTeammatesGodModeEnabled()) { return; } float time = Time.time; if (time - _lastAllTeammatesGodCheckTime < 1f) { return; } _lastAllTeammatesGodCheckTime = time; List list = SemiFunc.PlayerGetList(); if (list == null) { return; } foreach (PlayerAvatar item in list) { if (!((Object)(object)item == (Object)null)) { string text = PlayerAvatarSteamIDRef.Invoke(item); if (!string.IsNullOrEmpty(text) && !_processedGodModeTeammates.Contains(text)) { _processedGodModeTeammates.Add(text); SetPlayerGodMode(text, enable: true); } } } } public static Color GetWingsColor(int index) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return (Color)(index switch { 1 => WingsColors[0], 2 => WingsColors[1], _ => Color.white, }); } public static string GetColorName(int index) { switch (index) { case 1: if (!UseChinese()) { return "Pink (Level 2)"; } return "原版粉色 (2级)"; case 2: if (!UseChinese()) { return "Blue (Level 3)"; } return "原版蓝色 (3级)"; default: return ""; } } public static bool IsWingsShouldActive() { if (!IsWingsAlwaysShowEnabled()) { return false; } float wingsShowFrequency = GetWingsShowFrequency(); if (wingsShowFrequency <= 0.01f) { return true; } return (int)((PhotonNetwork.InRoom ? PhotonNetwork.Time : ((double)Time.time)) / (double)wingsShowFrequency) % 2 == 0; } public static int GetDictValue(Dictionary dict, string key, int defaultVal = 0) { if (dict == null || string.IsNullOrEmpty(key)) { return defaultVal; } if (!dict.TryGetValue(key, out var value)) { return defaultVal; } return value; } internal static void EnsureEnemyScaleSync() { if (!((Object)(object)_enemyScaleSync != (Object)null) && !((Object)(object)PunManager.instance == (Object)null)) { _enemyScaleSync = ((Component)PunManager.instance).GetComponent(); if ((Object)(object)_enemyScaleSync == (Object)null) { _enemyScaleSync = ((Component)PunManager.instance).gameObject.AddComponent(); } } } public static void SetEnemyScale(EnemyParent ep, float scale) { if ((Object)(object)ep == (Object)null) { return; } scale = Mathf.Clamp(scale, 0.1f, 5f); int viewID = ((MonoBehaviourPun)ep).photonView.ViewID; _enemyScaleDict[viewID] = scale; ApplyEnemyScale(ep, scale); if (PhotonNetwork.InRoom) { EnsureEnemyScaleSync(); if ((Object)(object)_enemyScaleSync != (Object)null) { _enemyScaleSync.BroadcastScale(viewID, scale); } } } internal static void ApplyEnemyScale(EnemyParent ep, float scale) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ep == (Object)null)) { ((Component)ep).transform.localScale = Vector3.one * scale; } } private void Awake() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.DestroyImmediate((Object)(object)((Component)this).gameObject); return; } Instance = this; DetachFromManager(); ResetConfigIfVersionChanged(); BindConfig(); try { _harmony = new Harmony("zichen.gametools"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"GameTools Harmony patches applied successfully."); } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Failed to patch Harmony: {arg}"); } TryHookREPOConfig(_harmony); ((BaseUnityPlugin)this).Logger.LogInfo((object)"GameTools v1.0.9 已加载。"); try { SceneManager.sceneLoaded += OnSceneLoaded; } catch (Exception arg2) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Failed to bind sceneLoaded: {arg2}"); } } internal static void LogInfo(string msg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)msg); } } internal static void LogWarning(string msg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)msg); } } internal static void LogError(string msg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogError((object)msg); } } private bool IsTyping() { if (_windowOpen && GUIUtility.keyboardControl != 0) { return true; } try { EventSystem current = EventSystem.current; if ((Object)(object)current != (Object)null && (Object)(object)current.currentSelectedGameObject != (Object)null) { string text = ((Object)current.currentSelectedGameObject).name.ToLower(); if (text.Contains("input") || text.Contains("chat") || text.Contains("text")) { return true; } } } catch { } return false; } private void Update() { if (IsOpenKeyPressed()) { SetWindowOpen(!_windowOpen); } HostReadTeammateCustomPropertiesUpgrades(); if (IsStaticModEnabled() && (Object)(object)PlayerController.instance != (Object)null && _cfgEnableGKeyHotkey != null && _cfgEnableGKeyHotkey.Value && !_windowOpen) { try { bool flag = false; try { Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.gKey).isPressed) { flag = true; } } catch { } bool num = flag && !_gKeyWasPressed; _gKeyWasPressed = flag; if (num && !IsTyping() && !string.IsNullOrEmpty(PlayerSteamIDRef.Invoke(PlayerController.instance))) { bool flag2 = true; if (_cfgGodModeFlightEnabled != null) { flag2 = !_cfgGodModeFlightEnabled.Value; _cfgGodModeFlightEnabled.Value = flag2; } SaveRuntimeConfig(); string text = ((!UseChinese()) ? (flag2 ? "[GameTools] \ud83d\udd4a\ufe0f God Flight Mode: ENABLED (G)" : "[GameTools] \ud83d\udd4a\ufe0f God Flight Mode: DISABLED (G)") : (flag2 ? "[GameTools] \ud83d\udd4a\ufe0f 上帝飞行无敌模式:已开启 (G)" : "[GameTools] \ud83d\udd4a\ufe0f 上帝飞行无敌模式:已关闭 (G)")); ((BaseUnityPlugin)this).Logger.LogInfo((object)text); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[GameTools] God Mode G key toggle error: " + ex.Message)); } } if (_cfgModEnabled != null && _cfgModEnabled.Value && (Object)(object)PlayerController.instance != (Object)null && _cfgEnableHKeyHotkey != null && _cfgEnableHKeyHotkey.Value && !_windowOpen) { try { bool flag3 = false; try { Keyboard current2 = Keyboard.current; if (current2 != null && ((ButtonControl)current2.hKey).isPressed) { flag3 = true; } } catch { } bool num2 = flag3 && !_hKeyWasPressed; _hKeyWasPressed = flag3; if (num2 && !IsTyping()) { bool flag4 = true; if (_cfgThirdPersonEnabled != null) { flag4 = !_cfgThirdPersonEnabled.Value; _cfgThirdPersonEnabled.Value = flag4; } SaveRuntimeConfig(); string text2 = ((!UseChinese()) ? (flag4 ? "[GameTools] \ud83c\udfa5 Third Person View: ENABLED (H)" : "[GameTools] \ud83c\udfa5 Third Person View: DISABLED (H)") : (flag4 ? "[GameTools] \ud83c\udfa5 第三人称视角:已开启 (H)" : "[GameTools] \ud83c\udfa5 第三人称视角:已关闭 (H)")); ((BaseUnityPlugin)this).Logger.LogInfo((object)text2); } } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[GameTools] Third Person H key toggle error: " + ex2.Message)); } } if (_windowOpen) { KeepCursorFree(); } _masterCheckTimer += Time.deltaTime; if (_masterCheckTimer >= 3f) { _masterCheckTimer = 0f; PerformActiveFeaturesCheck(); } if (!IsStaticModEnabled()) { RestoreRealUpgrades(); return; } if (!string.IsNullOrEmpty(((Object)(object)PlayerController.instance != (Object)null) ? PlayerSteamIDRef.Invoke(PlayerController.instance) : null) && (Object)(object)StatsManager.instance != (Object)null) { if (_realUpgradeHealth != -1 || _realUpgradeStamina != -1 || _realUpgradeSpeed != -1) { RestoreRealUpgrades(); } } else { _realUpgradeHealth = -1; _realUpgradeStamina = -1; _realUpgradeSpeed = -1; _globalOverrideInited = false; } if (IsAutoReviveTeammatesEnabled()) { float time = Time.time; if (time - _lastAutoReviveCheckTime >= 1f) { _lastAutoReviveCheckTime = time; if (!SemiFunc.IsMultiplayer()) { PlayerAvatar val = (((Object)(object)PlayerController.instance != (Object)null && (Object)(object)PlayerController.instance.playerAvatarScript != (Object)null) ? ((Component)PlayerController.instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val != (Object)null) { if (PlayerAvatarDeadSetRef.Invoke(val)) { if (!_teammateDeathTimers.ContainsKey("local")) { _teammateDeathTimers["local"] = 0f; } else if (_teammateDeathTimers["local"] >= 0f) { _teammateDeathTimers["local"] += 1f; if (_teammateDeathTimers["local"] >= 5f) { _teammateDeathTimers["local"] = -9999f; HandleReviveAndTeleport(val); } } } else { _teammateDeathTimers.Remove("local"); } } } else if (PhotonNetwork.InRoom) { List list = SemiFunc.PlayerGetList(); if (list != null) { List list2 = new List(); foreach (PlayerAvatar item in list) { if ((Object)(object)item == (Object)null || (Object)(object)item.photonView == (Object)null || item.photonView.Owner == null) { continue; } string text3 = item.photonView.Owner.ActorNumber.ToString(); if (PlayerAvatarDeadSetRef.Invoke(item)) { if (!_teammateDeathTimers.ContainsKey(text3)) { _teammateDeathTimers[text3] = 0f; } else if (_teammateDeathTimers[text3] >= 0f) { _teammateDeathTimers[text3] += 1f; if (_teammateDeathTimers[text3] >= 5f) { _teammateDeathTimers[text3] = -9999f; HandleReviveAndTeleport(item); } } } else { list2.Add(text3); } } foreach (string item2 in list2) { _teammateDeathTimers.Remove(item2); } } } } } else { _teammateDeathTimers.Clear(); } if (!((Object)(object)EnemyDirector.instance != (Object)null) || EnemyDirector.instance.enemiesSpawned == null) { return; } float spawnRateMultiplier = GetSpawnRateMultiplier(); if (spawnRateMultiplier > 1f) { foreach (EnemyParent item3 in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item3 != (Object)null && !EnemyParentSpawnedRef.Invoke(item3)) { float despawnedTimer = item3.DespawnedTimer; if (despawnedTimer > 0f) { float num3 = Time.deltaTime * (spawnRateMultiplier - 1f); item3.DespawnedTimerSet(Mathf.Max(0f, despawnedTimer - num3), false); } } } } if (!IsLimitActionAndOverchargeEnabled()) { return; } foreach (EnemyParent item4 in EnemyDirector.instance.enemiesSpawned) { if (!((Object)(object)item4 == (Object)null)) { if (item4.actionMultiplier > 0.1f) { item4.actionMultiplier = 0.1f; } if (item4.overchargeMultiplier > 0.1f) { item4.overchargeMultiplier = 0.1f; } } } } private void PerformActiveFeaturesCheck() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown try { if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null && (!((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_Active", out object value) || !(value is bool) || !(bool)value)) { Hashtable val = new Hashtable(); val[(object)"GT_Active"] = true; PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { SyncProhibitOthersToRoom(); } if (!IsStaticModEnabled() || !IsTab0Enabled()) { DisableAndRestoreTab1(); DisableAndRestoreTab2(); DisableAndRestoreTab3(); DisableAndRestoreTab4(); DisableAndRestoreTab5(); DisableAndRestoreTab6(); return; } if (!IsTab1Enabled()) { DisableAndRestoreTab1(); } if (!IsTab2Enabled()) { DisableAndRestoreTab2(); } if (!IsTab3Enabled()) { DisableAndRestoreTab3(); } if (!IsTab4Enabled()) { DisableAndRestoreTab4(); } if (!IsTab5Enabled()) { DisableAndRestoreTab5(); } if (!IsTab6Enabled()) { DisableAndRestoreTab6(); } } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogWarning((object)$"[PerformActiveFeaturesCheck Error]: {arg}"); } } private void DisableAndRestoreTab1() { bool flag = false; if (_cfgAutoReviveTeammates != null && _cfgAutoReviveTeammates.Value) { flag = true; } if (_cfgAllTeammatesGodMode != null && _cfgAllTeammatesGodMode.Value) { flag = true; } if (_localGodModePlayers.Count > 0) { flag = true; } if (flag) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 1 is disabled. Restoring original player settings and disabling effects."); ResetPlayerSettings(); _localGodModePlayers.Clear(); OnAllTeammatesGodModeChanged(enable: false); } } private void DisableAndRestoreTab2() { bool flag = false; if (_cfgValuableGodMode != null && _cfgValuableGodMode.Value) { flag = true; } if (_cfgValuableGodModeBead != null && _cfgValuableGodModeBead.Value) { flag = true; } if (_cfgValuableGodModeWeapon != null && _cfgValuableGodModeWeapon.Value) { flag = true; } if (_cfgValuableGodModeVehicle != null && _cfgValuableGodModeVehicle.Value) { flag = true; } if (_cfgValuableGodModeCosmetic != null && _cfgValuableGodModeCosmetic.Value) { flag = true; } if (_cfgValuableGodModePotion != null && _cfgValuableGodModePotion.Value) { flag = true; } if (_cfgValuableGodModeHealPack != null && _cfgValuableGodModeHealPack.Value) { flag = true; } if (_cfgValuableGodModeBattery != null && _cfgValuableGodModeBattery.Value) { flag = true; } if (_cfgValuableGodModeMoneyBag != null && _cfgValuableGodModeMoneyBag.Value) { flag = true; } if (flag) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 2 (Item Control) is disabled. Disabling all items god mode."); _cfgValuableGodMode.Value = false; _cfgValuableGodModeBead.Value = false; _cfgValuableGodModeWeapon.Value = false; _cfgValuableGodModeVehicle.Value = false; _cfgValuableGodModeCosmetic.Value = false; if (_cfgValuableGodModePotion != null) { _cfgValuableGodModePotion.Value = false; } if (_cfgValuableGodModeHealPack != null) { _cfgValuableGodModeHealPack.Value = false; } if (_cfgValuableGodModeBattery != null) { _cfgValuableGodModeBattery.Value = false; } if (_cfgValuableGodModeMoneyBag != null) { _cfgValuableGodModeMoneyBag.Value = false; } UpdateValuablesGodModeState(forceDisableAll: true); SaveRuntimeConfig(); } } private void DisableAndRestoreTab3() { //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Expected O, but got Unknown bool flag = false; if (_cfgWingsAlwaysShow != null && _cfgWingsAlwaysShow.Value && !IsProhibitedByHost()) { flag = true; } if (_cfgTumbleFlyEnabled != null && _cfgTumbleFlyEnabled.Value) { flag = true; } if (_cfgJumpMultiplierEnabled != null && _cfgJumpMultiplierEnabled.Value) { flag = true; } if (_cfgInfiniteWeaponBattery != null && _cfgInfiniteWeaponBattery.Value) { flag = true; } if (_cfgInfiniteChargingStation != null && !_cfgInfiniteChargingStation.Value) { flag = true; } if (_cfgChargingStationHeal != null && !_cfgChargingStationHeal.Value) { flag = true; } if (_cfgThirdPersonEnabled != null && _cfgThirdPersonEnabled.Value && !IsProhibitedByHost()) { flag = true; } if (_cfgGodModeFlightEnabled != null && _cfgGodModeFlightEnabled.Value) { flag = true; } if (_cfgWingsColorIndex != null && _cfgWingsColorIndex.Value > 0 && !IsProhibitedByHost()) { flag = true; } if (_cfgWingsShowFrequency != null && _cfgWingsShowFrequency.Value > 0 && !IsProhibitedByHost()) { flag = true; } if (_cfgLimitCosmeticBoxes != null && !_cfgLimitCosmeticBoxes.Value) { flag = true; } if (_cfgLimitCosmeticBoxesValue != null && _cfgLimitCosmeticBoxesValue.Value != 11) { flag = true; } if (!flag) { return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 3 is disabled. Restoring original visual settings and disabling effects."); bool value = _cfgThirdPersonEnabled != null && _cfgThirdPersonEnabled.Value; float value2 = ((_cfgThirdPersonDistance != null) ? _cfgThirdPersonDistance.Value : 2.2f); float value3 = ((_cfgThirdPersonHeight != null) ? _cfgThirdPersonHeight.Value : 0.5f); float value4 = ((_cfgThirdPersonModelScale != null) ? _cfgThirdPersonModelScale.Value : 0.8f); float value5 = ((_cfgThirdPersonHorizontal != null) ? _cfgThirdPersonHorizontal.Value : 0f); bool value6 = _cfgWingsAlwaysShow != null && _cfgWingsAlwaysShow.Value; int value7 = ((_cfgWingsColorIndex != null) ? _cfgWingsColorIndex.Value : 0); int value8 = ((_cfgWingsShowFrequency != null) ? _cfgWingsShowFrequency.Value : 0); bool value9 = _cfgFlipEnabled != null && _cfgFlipEnabled.Value; bool value10 = _cfgFlipShowToSelf != null && _cfgFlipShowToSelf.Value; bool value11 = _cfgSpinEnabled != null && _cfgSpinEnabled.Value; int value12 = ((_cfgSpinDirection == null) ? 1 : _cfgSpinDirection.Value); float value13 = ((_cfgSpinSpeed != null) ? _cfgSpinSpeed.Value : 1f); bool value14 = _cfgSpinShowToSelf != null && _cfgSpinShowToSelf.Value; bool value15 = _cfgSpinFreeze != null && _cfgSpinFreeze.Value; int value16 = ((_cfgSpinAxis == null) ? 1 : _cfgSpinAxis.Value); bool value17 = _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value; int value18 = ((_cfgEyeEffect != null) ? _cfgEyeEffect.Value : 2); bool value19 = _cfgEyeBigPupil != null && _cfgEyeBigPupil.Value; int value20 = ((_cfgEyeColorMode != null) ? _cfgEyeColorMode.Value : 0); bool value21 = _cfgFlashlightColorEnabled != null && _cfgFlashlightColorEnabled.Value; int value22 = ((_cfgFlashlightColor != null) ? _cfgFlashlightColor.Value : 0); ResetVisualSettings(); if (IsProhibitedByHost()) { if (_cfgThirdPersonEnabled != null) { _cfgThirdPersonEnabled.Value = value; } if (_cfgThirdPersonDistance != null) { _cfgThirdPersonDistance.Value = value2; } if (_cfgThirdPersonHeight != null) { _cfgThirdPersonHeight.Value = value3; } if (_cfgThirdPersonModelScale != null) { _cfgThirdPersonModelScale.Value = value4; } if (_cfgThirdPersonHorizontal != null) { _cfgThirdPersonHorizontal.Value = value5; } if (_cfgWingsAlwaysShow != null) { _cfgWingsAlwaysShow.Value = value6; } if (_cfgWingsColorIndex != null) { _cfgWingsColorIndex.Value = value7; } if (_cfgWingsShowFrequency != null) { _cfgWingsShowFrequency.Value = value8; } if (_cfgFlipEnabled != null) { _cfgFlipEnabled.Value = value9; } if (_cfgFlipShowToSelf != null) { _cfgFlipShowToSelf.Value = value10; } if (_cfgSpinEnabled != null) { _cfgSpinEnabled.Value = value11; } if (_cfgSpinDirection != null) { _cfgSpinDirection.Value = value12; } if (_cfgSpinSpeed != null) { _cfgSpinSpeed.Value = value13; } if (_cfgSpinShowToSelf != null) { _cfgSpinShowToSelf.Value = value14; } if (_cfgSpinFreeze != null) { _cfgSpinFreeze.Value = value15; } if (_cfgSpinAxis != null) { _cfgSpinAxis.Value = value16; } if (_cfgEyeEffectEnabled != null) { _cfgEyeEffectEnabled.Value = value17; } if (_cfgEyeEffect != null) { _cfgEyeEffect.Value = value18; } if (_cfgEyeBigPupil != null) { _cfgEyeBigPupil.Value = value19; } if (_cfgEyeColorMode != null) { _cfgEyeColorMode.Value = value20; } if (_cfgFlashlightColorEnabled != null) { _cfgFlashlightColorEnabled.Value = value21; } if (_cfgFlashlightColor != null) { _cfgFlashlightColor.Value = value22; } SaveRuntimeConfig(); } if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val = new Hashtable(); val[(object)"GT_WingsAlwaysShow"] = false; val[(object)"GT_WingsColorIndex"] = 0; val[(object)"GT_EyeBigPupil"] = false; val[(object)"GT_EyeEffect"] = 0; if (_cfgLimitCosmeticBoxes != null) { _cfgLimitCosmeticBoxes.Value = true; } if (_cfgLimitCosmeticBoxesValue != null) { _cfgLimitCosmeticBoxesValue.Value = 11; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } private void DisableAndRestoreTab4() { if (_cfgSpawnedAutoRespawn || _cfgSpawnedDelayPull) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 4 is disabled. Disabling spawner options."); _cfgSpawnedAutoRespawn = false; _cfgSpawnedDelayPull = false; } } private void DisableAndRestoreTab5() { bool flag = false; if (_cfgSpawnRateMultiplier != null && _cfgSpawnRateMultiplier.Value != 1f) { flag = true; } if (_cfgLimitActionAndOvercharge != null && _cfgLimitActionAndOvercharge.Value) { flag = true; } if (_enemyScaleDict.Count > 0) { flag = true; } if (!flag) { return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 5 is disabled. Restoring original monster settings."); ResetMonsterData(); List list = (((Object)(object)EnemyDirector.instance != (Object)null) ? EnemyDirector.instance.enemiesSpawned : null); if (list != null) { foreach (EnemyParent item in list) { if ((Object)(object)item != (Object)null) { SetEnemyScale(item, 1f); } } } _enemyScaleDict.Clear(); } private void DisableAndRestoreTab6() { if (_cfgUpgradeLimitEnabled != null && _cfgUpgradeLimitEnabled.Value) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[GameTools] Tab 6 is disabled. Disabling upgrade limit control."); _cfgUpgradeLimitEnabled.Value = false; SaveRuntimeConfig(); } } public static void SetProhibitOthers(bool enable) { if (_cfgProhibitOthers != null) { _cfgProhibitOthers.Value = enable; } SyncProhibitOthersToRoom(); } public static void SyncProhibitOthersToRoom() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { Hashtable val = new Hashtable(); val[(object)"GT_ProhibitOthers"] = IsProhibitOthersEnabled(); PhotonNetwork.CurrentRoom.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)$"[GameTools] Sync ProhibitOthers={IsProhibitOthersEnabled()} to room."); } } } public static bool IsProhibitOthersEnabled() { if (_cfgProhibitOthers != null) { return _cfgProhibitOthers.Value; } return false; } private void LateUpdate() { if (_windowOpen && IsStaticModEnabled()) { KeepCursorFree(); } } public static void RestoreRealUpgrades() { if ((Object)(object)StatsManager.instance == (Object)null) { return; } string text = (((Object)(object)PlayerController.instance != (Object)null) ? PlayerSteamIDRef.Invoke(PlayerController.instance) : null); if (string.IsNullOrEmpty(text)) { return; } bool flag = false; if (_realUpgradeHealth != -1) { StatsManager.instance.playerUpgradeHealth[text] = _realUpgradeHealth; _realUpgradeHealth = -1; flag = true; } if (_realUpgradeStamina != -1) { StatsManager.instance.playerUpgradeStamina[text] = _realUpgradeStamina; _realUpgradeStamina = -1; flag = true; } if (_realUpgradeSpeed != -1) { StatsManager.instance.playerUpgradeSpeed[text] = _realUpgradeSpeed; _realUpgradeSpeed = -1; flag = true; } if (flag) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)"[GameTools] Restored player upgrades to original values."); } if ((Object)(object)StatsUI.instance != (Object)null) { StatsUI.instance.Fetch(); } } } private void TakeCursor() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) _prevLockMode = Cursor.lockState; _prevVisible = Cursor.visible; try { if ((Object)(object)CursorManager.instance != (Object)null) { CursorManager.instance.Unlock(9999f); } } catch { } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } private static void KeepCursorFree() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)Cursor.lockState != 0) { Cursor.lockState = (CursorLockMode)0; } if (!Cursor.visible) { Cursor.visible = true; } } private void ReleaseCursor() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Cursor.lockState = _prevLockMode; Cursor.visible = _prevVisible; try { if ((Object)(object)CursorManager.instance != (Object)null) { CursorManagerUnlockTimerRef.Invoke(CursorManager.instance) = 0f; } } catch { } } private void SetWindowOpen(bool open) { if (_windowOpen != open) { _windowOpen = open; if (open) { _windowCentered = false; TakeCursor(); _lastTab = -1; } else { ReleaseCursor(); } } } private void BindConfig() { //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown DisplayLanguage defaultVal = DetectDefaultLanguage(); try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; if (File.Exists(configFilePath)) { Match match = Regex.Match(File.ReadAllText(configFilePath), "(?m)^GameTools Language\\s*=\\s*(.+?)\\s*$"); if (match.Success) { string text = match.Groups[1].Value.Trim(); if (text == "中文" || text == DisplayLanguage.中文.ToString()) { defaultVal = DisplayLanguage.中文; } else if (text == "English" || text == DisplayLanguage.English.ToString()) { defaultVal = DisplayLanguage.English; } } } } catch { } _cfgLanguage = BindI18N("A.Mod Info", "A.模组信息", "GameToolsLanguage", "语言", "Switch display language. Live updates UI.", "切换显示语言。实时刷新面板。", defaultVal, null, 980, "Language"); BindReadOnlyI18N("A.Mod Info", "A.模组信息", "GameToolsModName", "模组名称", "GameTools", "游戏工具箱", 1000, "Mod Name"); BindReadOnlyI18N("A.Mod Info", "A.模组信息", "GameToolsModVersion", "模组版本号", "1.0.9", "1.0.9", 990, "Mod Version"); _cfgModEnabled = BindI18N("B.Global Settings", "B.全局设置", "Mod Enable", "模组启用", "Disable to turn off the whole mod.", "关闭整个模组,使其彻底失效。", defaultVal: true); _cfgProhibitOthers = BindI18N("B.Global Settings", "B.全局设置", "Prohibit Others", "禁止其他玩家使用此模组", "If enabled as host, prohibits other players in the room from using this mod.", "作为房主时,如果开启此项,将禁止房间内其他玩家使用该模组功能。", defaultVal: false); _cfgEnableHKeyHotkey = BindI18N("B.Global Settings", "B.全局设置", "Enable H-Key Hotkey", "启用 H 键快捷键切换第三人称", "If enabled, pressing H key in-game toggles third person view.", "如果启用,可以在游戏内按 H 键直接切换第三人称视角。", defaultVal: true); _cfgEnableGKeyHotkey = BindI18N("B.Global Settings", "B.全局设置", "Enable G-Key Hotkey", "启用 G 键快捷键切换上帝飞行", "If enabled, pressing G key in-game toggles god flight mode.", "如果启用,可以在游戏内按 G 键直接切换上帝飞行无敌模式。", defaultVal: true); _openKey = BindI18N("B.Global Settings", "B.全局设置", "Open Keybind", "打开快捷键", "The key used to open/close the GUI menu.", "呼出或关闭本界面的快捷键。", "F4", (AcceptableValueBase)(object)new AcceptableValueList(AvailableKeybinds)); _runtimeConfig = new ConfigFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Config.ConfigFilePath), "zichen.gametoolsruntime.cfg"), false); _cfgCosmeticsEnabled = _runtimeConfig.Bind("Runtime", "CosmeticsEnabled", true, "Enable Cosmetics Tab Features"); _cfgWingsAlwaysShow = _runtimeConfig.Bind("Runtime", "WingsAlwaysShow", false, "Wings Always Show"); _cfgEnableWingsSound = _runtimeConfig.Bind("Runtime", "EnableWingsSound", false, "Enable Wings Sound"); _cfgWingsColorIndex = _runtimeConfig.Bind("Runtime", "WingsColorIndex", 2, "Wings Color Index"); _cfgWingsShowFrequency = _runtimeConfig.Bind("Runtime", "WingsShowFrequency", 0, "Wings Show Frequency"); _cfgFlipEnabled = _runtimeConfig.Bind("Runtime", "FlipEnabled", false, "Model Flip Enabled"); _cfgFlipShowToSelf = _runtimeConfig.Bind("Runtime", "FlipShowToSelf", false, "Show Flip to Self"); _cfgEyeEffectEnabled = _runtimeConfig.Bind("Runtime", "EyeEffectEnabled", false, "Eye Effect Enabled"); _cfgEyeEffect = _runtimeConfig.Bind("Runtime", "EyeEffect", 2, "Eye Effect Selection"); _cfgEyeBigPupil = _runtimeConfig.Bind("Runtime", "EyeBigPupil", false, "Eye Big Pupil"); _cfgEyePupilScaleAuto = _runtimeConfig.Bind("Runtime", "EyePupilScaleAuto", false, "Eye Pupil Scale Auto"); _cfgEyePupilScaleSpeed = _runtimeConfig.Bind("Runtime", "EyePupilScaleSpeed", 0.3f, "Eye Pupil Scale Speed"); _cfgEyeColorMode = _runtimeConfig.Bind("Runtime", "EyeColorMode", 0, "Eye Color Mode (0=Single, 1=Multi)"); _cfgEyeSingleColor = _runtimeConfig.Bind("Runtime", "EyeSingleColor", 2, "Eye Single Color"); _cfgEyeMultiSelectRed = _runtimeConfig.Bind("Runtime", "EyeMultiSelectRed", true, "Eye Multi-select Red"); _cfgEyeMultiSelectGreen = _runtimeConfig.Bind("Runtime", "EyeMultiSelectGreen", true, "Eye Multi-select Green"); _cfgEyeMultiSelectOrange = _runtimeConfig.Bind("Runtime", "EyeMultiSelectOrange", false, "Eye Multi-select Orange"); _cfgEyeMultiSelectLove = _runtimeConfig.Bind("Runtime", "EyeMultiSelectLove", false, "Eye Multi-select Love"); _cfgEyeMultiSelectInverted = _runtimeConfig.Bind("Runtime", "EyeMultiSelectInverted", false, "Eye Multi-select Inverted"); _cfgEyeSwapInterval = _runtimeConfig.Bind("Runtime", "EyeSwapInterval", 1f, "Eye Swap Interval"); _cfgFlashlightColorEnabled = _runtimeConfig.Bind("Runtime", "FlashlightColorEnabled", false, "Flashlight Color Enabled"); _cfgFlashlightColor = _runtimeConfig.Bind("Runtime", "FlashlightColorIndex", 0, "Flashlight Color Index"); _cfgSpinEnabled = _runtimeConfig.Bind("Runtime", "SpinEnabled", false, "Enable Model Auto Spin"); _cfgSpinDirection = _runtimeConfig.Bind("Runtime", "SpinDirection", 1, "Model Spin Direction: 1=Clockwise 2=Counter-Clockwise"); _cfgSpinSpeed = _runtimeConfig.Bind("Runtime", "SpinSpeed", 0.3f, "Model Spin Speed in rotations per second"); _cfgSpinShowToSelf = _runtimeConfig.Bind("Runtime", "SpinShowToSelf", false, "Show Spin to Self"); _cfgSpinFreeze = _runtimeConfig.Bind("Runtime", "SpinFreeze", false, "Freeze Model Spin Position"); _cfgSpinAxis = _runtimeConfig.Bind("Runtime", "SpinAxis", 1, "Model Spin Axis"); _cfgSpinRadius = _runtimeConfig.Bind("Runtime", "SpinRadius", 0f, "Model Spin Radius (0.0 - 5.0m)"); if (_cfgSpinSpeed != null && Mathf.Abs(_cfgSpinSpeed.Value - 1f) < 0.01f) { _cfgSpinSpeed.Value = 0.3f; _runtimeConfig.Save(); } if (_cfgEyePupilScaleSpeed != null && (Mathf.Abs(_cfgEyePupilScaleSpeed.Value - 1f) < 0.01f || Mathf.Abs(_cfgEyePupilScaleSpeed.Value - 0.2f) < 0.01f)) { _cfgEyePupilScaleSpeed.Value = 0.3f; _runtimeConfig.Save(); } if (_cfgEyeSwapInterval != null && (Mathf.Abs(_cfgEyeSwapInterval.Value - 0.5f) < 0.01f || Mathf.Abs(_cfgEyeSwapInterval.Value - 0.3f) < 0.01f)) { _cfgEyeSwapInterval.Value = 1f; _runtimeConfig.Save(); } _cfgJumpMultiplierEnabled = _runtimeConfig.Bind("Runtime", "JumpMultiplierEnabled", false, "Super Jump Enabled"); _cfgJumpMultiplier = _runtimeConfig.Bind("Runtime", "JumpMultiplier", 1.5f, "Jump Force Multiplier"); _cfgInfiniteStamina = _runtimeConfig.Bind("Runtime", "InfiniteStamina", true, "Infinite Stamina"); _cfgTumbleFlyEnabled = _runtimeConfig.Bind("Runtime", "TumbleFlyEnabled", false, "Tumble Fly Enabled"); _cfgInfiniteWeaponBattery = _runtimeConfig.Bind("Runtime", "InfiniteWeaponBattery", false, "Infinite Weapon Battery"); _cfgInfiniteChargingStation = _runtimeConfig.Bind("ChargingStationEnhancements", "InfiniteChargingStation", true, "Infinite Charging Station Energy"); _cfgChargingStationHeal = _runtimeConfig.Bind("ChargingStationEnhancements", "ChargingStationHeal", true, "Heals 5 HP per second at the charging station"); _cfgInfBatteryMelee = _runtimeConfig.Bind("Runtime", "InfBatteryMelee", true, "Infinite Battery for Melee"); _cfgInfBatteryRanged = _runtimeConfig.Bind("Runtime", "InfBatteryRanged", true, "Infinite Battery for Ranged"); _cfgInfBatteryVehicles = _runtimeConfig.Bind("Runtime", "InfBatteryVehicles", true, "Infinite Battery for Vehicles"); _cfgInfBatteryDrones = _runtimeConfig.Bind("Runtime", "InfBatteryDrones", true, "Infinite Battery for Drones"); _cfgInfBatteryTools = _runtimeConfig.Bind("Runtime", "InfBatteryTools", true, "Infinite Battery for Tools"); _cfgSpawnRateMultiplier = _runtimeConfig.Bind("Runtime", "SpawnRateMultiplier", 1f, "Spawn Rate Multiplier"); _cfgEnemyPullInterval = _runtimeConfig.Bind("Runtime", "EnemyPullInterval", 0.1f, "Enemy Pull Interval"); _cfgEnemyPullDistance = _runtimeConfig.Bind("Runtime", "EnemyPullDistance", 3f, "Enemy Pull Distance"); _cfgSpawnDistance = _runtimeConfig.Bind("Runtime", "SpawnDistance", 1f, "Spawn Distance in front of player"); _cfgRemovePillarLimit = _runtimeConfig.Bind("Runtime", "RemovePillarLimit", true, "Remove Pillar Limit"); _cfgPillarDropMultiplierEnabled = _runtimeConfig.Bind("Runtime", "PillarDropMultiplierEnabled", true, "Pillar Drop Multiplier Enabled"); _cfgPillarDropMultiplier = _runtimeConfig.Bind("Runtime", "PillarDropMultiplier", 1, "Pillar Drop Multiplier"); _cfgTeammateDeathDropBead = _runtimeConfig.Bind("Runtime", "TeammateDeathDropBead", false, "Teammates Drop Small Shard on Death"); _cfgTeammateReviveDropBead = _runtimeConfig.Bind("Runtime", "TeammateReviveDropBead", false, "Teammates Drop Small Shard on Revive"); _cfgLimitCosmeticBoxes = _runtimeConfig.Bind("Runtime", "LimitCosmeticBoxes", true, "Limit Cosmetic Boxes"); _cfgLimitCosmeticBoxesValue = _runtimeConfig.Bind("Runtime", "LimitCosmeticBoxesValue", 11, "Limit Cosmetic Boxes Value"); _cfgAutoReviveTeammates = _runtimeConfig.Bind("Runtime", "AutoReviveTeammates", false, "Auto Revive Teammates"); _cfgAutoReviveWhenSeen = _runtimeConfig.Bind("Runtime", "AutoReviveWhenSeen", false, "Auto Revive When Seen by Teammate"); _cfgReviveHeadOnTruck = _runtimeConfig.Bind("Runtime", "ReviveHeadOnTruck", true, "Revive when head is brought to truck"); _cfgReviveHeadOnExtraction = _runtimeConfig.Bind("Runtime", "ReviveHeadOnExtraction", true, "Revive when head is placed at extraction point"); _cfgReviveHeadOnCart = _runtimeConfig.Bind("Runtime", "ReviveHeadOnCart", true, "Revive when head is placed on a cart"); _cfgReviveAutoToTruck = _runtimeConfig.Bind("Runtime", "ReviveAutoToTruck", false, "After revive, auto teleport to truck"); _cfgDeathAutoToTruck = _runtimeConfig.Bind("Runtime", "DeathAutoToTruck", false, "Auto teleport to truck upon death"); _cfgDeathAutoToExtraction = _runtimeConfig.Bind("Runtime", "DeathAutoToExtraction", false, "Auto teleport to current extraction point upon death"); _cfgLimitActionAndOvercharge = _runtimeConfig.Bind("Runtime", "LimitActionAndOvercharge", false, "Limit Action And Overcharge Multiplier"); _cfgResetMonsterDataOnLevelLoad = _runtimeConfig.Bind("Runtime", "ResetMonsterDataOnLevelLoad", true, "Reset Monster Data On Level Load"); _cfgThirdPersonEnabled = _runtimeConfig.Bind("Runtime", "ThirdPersonEnabled", false, "Third Person Enabled"); _cfgThirdPersonDistance = _runtimeConfig.Bind("Runtime", "ThirdPersonDistance", 2.2f, "Third Person Distance"); _cfgThirdPersonHeight = _runtimeConfig.Bind("Runtime", "ThirdPersonHeight", 0.5f, "Third Person Height"); _cfgThirdPersonModelScale = _runtimeConfig.Bind("Runtime", "ThirdPersonModelScale", 0.8f, "Third Person Model Scale"); _cfgThirdPersonHorizontal = _runtimeConfig.Bind("Runtime", "ThirdPersonHorizontal", 0f, "Third Person Horizontal Offset"); _cfgGodModeFlightEnabled = _runtimeConfig.Bind("Runtime", "GodModeFlightEnabled", false, "God Mode Flight Enabled"); _cfgAllTeammatesGodMode = _runtimeConfig.Bind("Runtime", "AllTeammatesGodMode", false, "All Teammates God Mode"); _cfgValuableGodMode = _runtimeConfig.Bind("Runtime", "ValuableGodMode", false, "Valuable God Mode"); _cfgValuableGodModeBead = _runtimeConfig.Bind("Runtime", "ValuableGodModeBead", false, "Valuable God Mode Bead"); _cfgValuableGodModeWeapon = _runtimeConfig.Bind("Runtime", "ValuableGodModeWeapon", false, "Valuable God Mode Weapon"); _cfgValuableGodModeVehicle = _runtimeConfig.Bind("Runtime", "ValuableGodModeVehicle", false, "Valuable God Mode Vehicle"); _cfgValuableGodModeCosmetic = _runtimeConfig.Bind("Runtime", "ValuableGodModeCosmetic", false, "Valuable God Mode Cosmetic"); _cfgValuableGodModePotion = _runtimeConfig.Bind("Runtime", "ValuableGodModePotion", false, "Valuable God Mode Potion"); _cfgValuableGodModeHealPack = _runtimeConfig.Bind("Runtime", "ValuableGodModeHealPack", false, "Valuable God Mode Heal Pack"); _cfgValuableGodModeBattery = _runtimeConfig.Bind("Runtime", "ValuableGodModeBattery", false, "Valuable God Mode Battery"); _cfgValuableGodModeMoneyBag = _runtimeConfig.Bind("Runtime", "ValuableGodModeMoneyBag", false, "Valuable God Mode Money Bag"); _cfgTab0Enabled = _runtimeConfig.Bind("Runtime", "Tab0Enabled", true, "Tab 0 Global Settings Master Switch"); _cfgTab1Enabled = _runtimeConfig.Bind("Runtime", "Tab1Enabled", true, "Tab 1 Player Settings Master Switch"); _cfgTab2Enabled = _runtimeConfig.Bind("Runtime", "Tab2Enabled", true, "Tab 2 Item Control Master Switch"); _cfgTab3Enabled = _runtimeConfig.Bind("Runtime", "Tab3Enabled", true, "Tab 3 Visual Settings Master Switch"); _cfgTab4Enabled = _runtimeConfig.Bind("Runtime", "Tab4Enabled", true, "Tab 4 Spawner Settings Master Switch"); _cfgTab5Enabled = _runtimeConfig.Bind("Runtime", "Tab5Enabled", true, "Tab 5 Monster Settings Master Switch"); _cfgTab6Enabled = _runtimeConfig.Bind("Runtime", "Tab6Enabled", true, "Tab 6 Upgrade Settings Master Switch"); _cfgUpgradeLimitEnabled = _runtimeConfig.Bind("UpgradeControl", "UpgradeLimitEnabled", false, "Enable Upgrade Potion Limit Control"); string[] upgradeTypes = UpgradeTypes; foreach (string text2 in upgradeTypes) { _cfgLimitToggles[text2] = _runtimeConfig.Bind("UpgradeControl", "Limit_" + text2, false, "Limit max level for " + text2); _cfgLimitValues[text2] = _runtimeConfig.Bind("UpgradeControl", "Max_" + text2, 5, "Max level limit for " + text2); } if (_cfgLanguage != null) { _cfgLanguage.SettingChanged += delegate { RefreshAllI18N(); }; } } public static void SaveRuntimeConfig() { try { ConfigFile runtimeConfig = _runtimeConfig; if (runtimeConfig != null) { runtimeConfig.Save(); } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[SaveRuntimeConfig Error]: {arg}"); } } } private static DisplayLanguage DetectDefaultLanguage() { try { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { string text = pluginInfo.Key ?? string.Empty; PluginInfo value = pluginInfo.Value; object obj; if (value == null) { obj = null; } else { BepInPlugin metadata = value.Metadata; obj = ((metadata != null) ? metadata.Name : null); } if (obj == null) { obj = string.Empty; } string text2 = (string)obj; string[] chineseModKeywords = _chineseModKeywords; foreach (string value2 in chineseModKeywords) { if (text.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0 || text2.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0) { return DisplayLanguage.中文; } } chineseModKeywords = _chineseEnvironmentPluginGuids; foreach (string b in chineseModKeywords) { if (string.Equals(text, b, StringComparison.OrdinalIgnoreCase)) { return DisplayLanguage.中文; } } } } catch { } return DisplayLanguage.English; } private ConfigEntry BindI18N(string sectEN, string sectCN, string keyEN, string keyCN, string descEN, string descCN, T defaultVal, AcceptableValueBase acceptableValues = null, int? order = null, string displayEN = null) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown CfgI18N cfgI18N = NewI18N(sectEN, sectCN, keyEN, keyCN, descEN, descCN, readOnly: false, order); cfgI18N.DisplayEN = displayEN; ApplyI18N(cfgI18N); return (ConfigEntry)(object)(cfgI18N.Entry = (ConfigEntryBase)(object)((BaseUnityPlugin)this).Config.Bind(sectEN, keyEN, defaultVal, new ConfigDescription(descEN, acceptableValues, new object[1] { cfgI18N.Attrs }))); } private void BindReadOnlyI18N(string sectEN, string sectCN, string keyEN, string keyCN, string valueEN, string valueCN, int? order = null, string displayEN = null) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown CfgI18N cfgI18N = NewI18N(sectEN, sectCN, keyEN, keyCN, "", "", readOnly: true, order); cfgI18N.ValueEN = valueEN; cfgI18N.ValueCN = valueCN; cfgI18N.DisplayEN = displayEN; ApplyI18N(cfgI18N); cfgI18N.ReadOnlyEntry = ((BaseUnityPlugin)this).Config.Bind(sectEN, keyEN, valueEN, new ConfigDescription("", (AcceptableValueBase)null, new object[1] { cfgI18N.Attrs })); cfgI18N.Entry = (ConfigEntryBase)(object)cfgI18N.ReadOnlyEntry; if (cfgI18N.ReadOnlyEntry.Value != valueEN) { cfgI18N.ReadOnlyEntry.Value = valueEN; } } private static CfgI18N NewI18N(string sectEN, string sectCN, string keyEN, string keyCN, string descEN, string descCN, bool readOnly, int? order = null) { ConfigurationManagerAttributes configurationManagerAttributes = (readOnly ? new ConfigurationManagerAttributes { ReadOnly = true, HideDefaultButton = true } : new ConfigurationManagerAttributes()); if (order.HasValue) { configurationManagerAttributes.Order = order.Value; } CfgI18N cfgI18N = new CfgI18N { SectionEN = sectEN, SectionCN = sectCN, KeyEN = keyEN, KeyCN = keyCN, DescEN = descEN, DescCN = descCN, Attrs = configurationManagerAttributes }; _cfgI18Ns.Add(cfgI18N); _cfgByEnSection[sectEN] = cfgI18N; _cfgByEnKey[sectEN + "\0" + keyEN] = cfgI18N; if (!_cfgByKeyOnly.TryGetValue(keyEN, out var value)) { value = new List(2); _cfgByKeyOnly[keyEN] = value; } value.Add(cfgI18N); string text = FixNamingForLookup(keyEN); if (!string.Equals(text, keyEN, StringComparison.Ordinal)) { if (!_cfgByKeyOnly.TryGetValue(text, out var value2)) { value2 = new List(2); _cfgByKeyOnly[text] = value2; } if (!value2.Contains(cfgI18N)) { value2.Add(cfgI18N); } } return cfgI18N; } private static void ApplyI18N(CfgI18N i18n) { if (i18n == null || i18n.Attrs == null) { return; } i18n.Attrs.Category = i18n.SectionEN; bool flag = UseChinese(); i18n.Attrs.DispName = (flag ? i18n.KeyCN : (i18n.DisplayEN ?? i18n.KeyEN)); i18n.Attrs.Description = (flag ? i18n.DescCN : i18n.DescEN); if (i18n.ReadOnlyEntry != null) { string text = (flag ? i18n.ValueCN : i18n.ValueEN); if (i18n.ReadOnlyEntry.Value != text) { i18n.ReadOnlyEntry.Value = text; } } } private static void RefreshAllI18N() { for (int i = 0; i < _cfgI18Ns.Count; i++) { ApplyI18N(_cfgI18Ns[i]); } RefreshLiveLabels(); } private static string FixNamingForLookup(string input) { if (string.IsNullOrEmpty(input)) { return input; } input = Regex.Replace(input, "([a-z])([A-Z])", "$1 $2"); input = Regex.Replace(input, "([A-Z])([A-Z][a-z])", "$1 $2"); input = Regex.Replace(input, "\\s+", " "); input = Regex.Replace(input, "([A-Z]\\.)\\s([A-Z]\\.)", "$1$2"); return input.Trim(); } private void ResetConfigIfVersionChanged() { try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; if (File.Exists(configFilePath)) { string text = ReadConfigPluginVersion(configFilePath); if (!(text == "1.0.9")) { ((BaseUnityPlugin)this).Config.Clear(); File.Delete(configFilePath); ((BaseUnityPlugin)this).Config.Reload(); ((BaseUnityPlugin)this).Logger.LogWarning((object)(string.IsNullOrWhiteSpace(text) ? "Old config without Mod Version, reset to defaults." : ("Config version " + text + " -> 1.0.9, reset to defaults."))); } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Reset config failed: " + ex.Message)); } } private static string ReadConfigPluginVersion(string configPath) { if (!File.Exists(configPath)) { return null; } string input = File.ReadAllText(configPath); Match match = Regex.Match(input, "(?m)^GameToolsModVersion\\s*=\\s*(.+?)\\s*$"); if (!match.Success) { match = Regex.Match(input, "(?m)^Mod Version\\s*=\\s*(.+?)\\s*$"); } if (!match.Success) { match = Regex.Match(input, "(?m)^模组版本号\\s*=\\s*(.+?)\\s*$"); } if (!match.Success) { return null; } return match.Groups[1].Value.Trim(); } private void DetachFromManager() { ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } private void OnDestroy() { SetWindowOpen(open: false); RestoreRealUpgrades(); try { SceneManager.sceneLoaded -= OnSceneLoaded; } catch { } try { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } catch { } } public static void EnsureSafeDirectorsForShop() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown if ((Object)(object)LevelGenerator.Instance == (Object)null) { _tempLevelGenGo = new GameObject("GameTools_TempLevelGenerator"); LevelGenerator obj = _tempLevelGenGo.AddComponent(); obj.EnemyParent = new GameObject("GameTools_TempEnemyParent"); obj.EnemyParent.transform.SetParent(_tempLevelGenGo.transform); LevelGenerator.Instance = obj; } if ((Object)(object)EnemyDirector.instance == (Object)null) { _tempEnemyDirGo = new GameObject("GameTools_TempEnemyDirector"); EnemyDirector obj2 = _tempEnemyDirGo.AddComponent(); obj2.enemiesSpawned = new List(); EnemyDirector.instance = obj2; } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { _teleportedObjectIds.Clear(); if ((Object)(object)LevelGenerator.Instance != (Object)null && (Object)(object)_tempLevelGenGo != (Object)null && (Object)(object)((Component)LevelGenerator.Instance).gameObject == (Object)(object)_tempLevelGenGo) { LevelGenerator.Instance = null; } if ((Object)(object)EnemyDirector.instance != (Object)null && (Object)(object)_tempEnemyDirGo != (Object)null && (Object)(object)((Component)EnemyDirector.instance).gameObject == (Object)(object)_tempEnemyDirGo) { EnemyDirector.instance = null; } _tempLevelGenGo = null; _tempEnemyDirGo = null; if ((Object)(object)RunManager.instance != (Object)null && RunManagerLevelIsShopRef.Invoke(RunManager.instance)) { EnsureSafeDirectorsForShop(); } if (_cfgResetMonsterDataOnLevelLoad != null && _cfgResetMonsterDataOnLevelLoad.Value) { ResetGlobalMonsterData(); } } public static void ResetGlobalMonsterData() { _globalOverrideInited = false; SaveRuntimeConfig(); } public static void LoadAllSpawnables(bool force) { //IL_0a9f: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Expected O, but got Unknown //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Invalid comparison between Unknown and I4 //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Invalid comparison between Unknown and I4 //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Invalid comparison between Unknown and I4 //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Invalid comparison between Unknown and I4 //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Invalid comparison between Unknown and I4 //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Invalid comparison between Unknown and I4 //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Invalid comparison between Unknown and I4 //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Invalid comparison between Unknown and I4 //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Invalid comparison between Unknown and I4 //IL_0f1b: Unknown result type (might be due to invalid IL or missing references) //IL_0f20: Unknown result type (might be due to invalid IL or missing references) //IL_0f22: Unknown result type (might be due to invalid IL or missing references) //IL_0f39: Expected I4, but got Unknown if (_spawnablesLoaded && !force) { return; } _spawnablesEnemies.Clear(); _spawnablesCustomItems.Clear(); _spawnablesCustomEnemies.Clear(); _spawnablesCosmeticBoxes.Clear(); if ((Object)(object)EnemyDirector.instance != (Object)null) { IEnumerable enemiesDifficulty = EnemyDirector.instance.enemiesDifficulty1; IEnumerable first = enemiesDifficulty ?? Enumerable.Empty(); enemiesDifficulty = EnemyDirector.instance.enemiesDifficulty2; IEnumerable first2 = first.Concat(enemiesDifficulty ?? Enumerable.Empty()); enemiesDifficulty = EnemyDirector.instance.enemiesDifficulty3; IEnumerable enumerable = first2.Concat(enemiesDifficulty ?? Enumerable.Empty()); HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (EnemySetup item in enumerable) { if ((Object)(object)item == (Object)null || string.IsNullOrEmpty(((Object)item).name) || hashSet.Contains(((Object)item).name)) { continue; } hashSet.Add(((Object)item).name); int num = -1; if (item.spawnObjects != null) { foreach (PrefabRef spawnObject in item.spawnObjects) { if (spawnObject != null && (Object)(object)((PrefabRef)(object)spawnObject).Prefab != (Object)null) { EnemyHealth componentInChildren = ((PrefabRef)(object)spawnObject).Prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { num = componentInChildren.health; break; } } } } string extraInfo = ((num > 0) ? $"(HP: {num})" : ""); string name = ((Object)item).name.Replace("Enemy - ", "").Replace("Enemy ", ""); _spawnablesEnemies.Add(new SpawnableInfo { Name = name, InternalName = ((Object)item).name, Type = SpawnType.Enemy, Source = item, ExtraInfo = extraInfo }); } _spawnablesEnemies = (from e in _spawnablesEnemies orderby IsMultipleEnemy(e) ? 1 : 0, e.Name select e).ToList(); } _spawnablesMelee.Clear(); _spawnablesRanged.Clear(); _spawnablesOtherWeapons.Clear(); _spawnablesCarts.Clear(); _spawnablesVehicles.Clear(); _spawnablesPotions.Clear(); _spawnablesOthers.Clear(); _spawnablesDrones.Clear(); if ((Object)(object)StatsManager.instance != (Object)null && StatsManager.instance.itemDictionary != null) { foreach (Item value in StatsManager.instance.itemDictionary.Values) { if ((Object)(object)value == (Object)null || value.prefab == null || string.IsNullOrEmpty(value.itemName)) { continue; } if (value.itemName.IndexOf("Upgrade", StringComparison.OrdinalIgnoreCase) >= 0) { int num2 = -1; int num3 = -1; if ((Object)(object)value.value != (Object)null) { num2 = Mathf.RoundToInt(value.value.valueMin); num3 = Mathf.RoundToInt(value.value.valueMax); } string extraInfo2 = ""; if (num2 > 0) { extraInfo2 = ((num2 == num3) ? $"(${num2})" : $"(${num2}-{num3})"); } _spawnablesPotions.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Valuable, Source = value, ExtraInfo = extraInfo2 }); continue; } bool num4 = (int)value.itemType == 7; bool flag = (int)value.itemType == 9 || (int)value.itemType == 15; bool flag2 = (int)value.itemType == 6 || (int)value.itemType == 11; bool flag3 = (int)value.itemType == 2 || (int)value.itemType == 12; bool flag4 = (int)value.itemType == 14; bool flag5 = (int)value.itemType == 0; int num5 = -1; int num6 = -1; if ((Object)(object)value.value != (Object)null) { num5 = Mathf.RoundToInt(value.value.valueMin); num6 = Mathf.RoundToInt(value.value.valueMax); } string extraInfo3 = ""; if (num5 > 0) { extraInfo3 = ((num5 == num6) ? $"(${num5})" : $"(${num5}-{num6})"); } if (num4) { _spawnablesMelee.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Weapon, Source = value, ExtraInfo = extraInfo3 }); } else if (flag) { _spawnablesRanged.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Weapon, Source = value, ExtraInfo = extraInfo3 }); } else if (flag2) { _spawnablesOtherWeapons.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Weapon, Source = value, ExtraInfo = extraInfo3 }); } else if (flag3) { _spawnablesCarts.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Cart, Source = value, ExtraInfo = extraInfo3 }); } else if (flag4) { _spawnablesVehicles.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Vehicle, Source = value, ExtraInfo = extraInfo3 }); } else if (flag5) { _spawnablesDrones.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Other, Source = value, ExtraInfo = extraInfo3 }); } else { _spawnablesOthers.Add(new SpawnableInfo { Name = value.itemName, InternalName = value.itemName, Type = SpawnType.Other, Source = value, ExtraInfo = extraInfo3 }); } } } _spawnablesValuables.Clear(); if ((Object)(object)RunManager.instance != (Object)null && RunManager.instance.levels != null) { HashSet hashSet2 = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (Level level in RunManager.instance.levels) { if ((Object)(object)level == (Object)null || level.ValuablePresets == null) { continue; } foreach (LevelValuables valuablePreset in level.ValuablePresets) { if ((Object)(object)valuablePreset == (Object)null) { continue; } IEnumerable tiny = valuablePreset.tiny; IEnumerable first3 = tiny ?? Enumerable.Empty(); tiny = valuablePreset.small; IEnumerable first4 = first3.Concat(tiny ?? Enumerable.Empty()); tiny = valuablePreset.medium; IEnumerable first5 = first4.Concat(tiny ?? Enumerable.Empty()); tiny = valuablePreset.big; IEnumerable first6 = first5.Concat(tiny ?? Enumerable.Empty()); tiny = valuablePreset.wide; IEnumerable first7 = first6.Concat(tiny ?? Enumerable.Empty()); tiny = valuablePreset.tall; IEnumerable first8 = first7.Concat(tiny ?? Enumerable.Empty()); tiny = valuablePreset.veryTall; foreach (PrefabRef item2 in first8.Concat(tiny ?? Enumerable.Empty())) { if (item2 == null || !((PrefabRef)(object)item2).IsValid() || string.IsNullOrEmpty(((PrefabRef)(object)item2).PrefabName) || hashSet2.Contains(((PrefabRef)(object)item2).PrefabName)) { continue; } hashSet2.Add(((PrefabRef)(object)item2).PrefabName); int num7 = -1; int num8 = -1; if ((Object)(object)((PrefabRef)(object)item2).Prefab != (Object)null) { ValuableObject component = ((PrefabRef)(object)item2).Prefab.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.valuePreset != (Object)null) { num7 = Mathf.RoundToInt(component.valuePreset.valueMin); num8 = Mathf.RoundToInt(component.valuePreset.valueMax); } } string extraInfo4 = ""; if (num7 > 0) { extraInfo4 = ((num7 == num8) ? $"(${num7})" : $"(${num7}-{num8})"); } string name2 = ((PrefabRef)(object)item2).PrefabName.Replace("Valuable ", "").Replace("valuable ", ""); if (((PrefabRef)(object)item2).PrefabName.IndexOf("Upgrade", StringComparison.OrdinalIgnoreCase) >= 0) { _spawnablesPotions.Add(new SpawnableInfo { Name = name2, InternalName = ((PrefabRef)(object)item2).PrefabName, Type = SpawnType.Valuable, Source = item2, ExtraInfo = extraInfo4 }); } else { _spawnablesValuables.Add(new SpawnableInfo { Name = name2, InternalName = ((PrefabRef)(object)item2).PrefabName, Type = SpawnType.Valuable, Source = item2, ExtraInfo = extraInfo4 }); } } } } } List list = new List(); if ((Object)(object)AssetManager.instance != (Object)null) { foreach (GameObject item3 in new List { AssetManager.instance.enemyValuableSmall, AssetManager.instance.enemyValuableMedium, AssetManager.instance.enemyValuableBig }) { if (!((Object)(object)item3 == (Object)null)) { PrefabRef val = new PrefabRef(); ((PrefabRef)(object)val).SetPrefab(item3, "Valuables/" + ((Object)item3).name); int num9 = -1; int num10 = -1; ValuableObject component2 = item3.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.valuePreset != (Object)null) { num9 = Mathf.RoundToInt(component2.valuePreset.valueMin); num10 = Mathf.RoundToInt(component2.valuePreset.valueMax); } string extraInfo5 = ""; if (num9 > 0) { extraInfo5 = ((num9 == num10) ? $"(${num9})" : $"(${num9}-{num10})"); } string text = ((Object)item3).name; if (text.Equals("enemyValuableSmall", StringComparison.OrdinalIgnoreCase)) { text = (UseChinese() ? "滚动珠 (小)" : "Rolling Ball (Small)"); } else if (text.Equals("enemyValuableMedium", StringComparison.OrdinalIgnoreCase)) { text = (UseChinese() ? "滚动珠 (中)" : "Rolling Ball (Medium)"); } else if (text.Equals("enemyValuableBig", StringComparison.OrdinalIgnoreCase)) { text = (UseChinese() ? "滚动珠 (大)" : "Rolling Ball (Large)"); } list.Add(new SpawnableInfo { Name = text, InternalName = ((Object)item3).name, Type = SpawnType.Valuable, Source = val, ExtraInfo = extraInfo5 }); } } } for (int num11 = _spawnablesValuables.Count - 1; num11 >= 0; num11--) { SpawnableInfo spawnableInfo = _spawnablesValuables[num11]; string text2 = (spawnableInfo.Name ?? "").ToLower(); string text3 = (spawnableInfo.InternalName ?? "").ToLower(); if (text3.Contains("enemyvaluable") || text3.Contains("enemy valuable") || text2.Contains("enemyvaluable") || text2.Contains("enemy valuable") || text2.Contains("rolling ball") || text2.Contains("rolling bead")) { list.Add(spawnableInfo); _spawnablesValuables.RemoveAt(num11); } } for (int num12 = _spawnablesOthers.Count - 1; num12 >= 0; num12--) { SpawnableInfo spawnableInfo2 = _spawnablesOthers[num12]; string text4 = (spawnableInfo2.Name ?? "").ToLower(); string text5 = (spawnableInfo2.InternalName ?? "").ToLower(); if (text5.Contains("enemyvaluable") || text5.Contains("enemy valuable") || text4.Contains("enemyvaluable") || text4.Contains("enemy valuable") || text4.Contains("rolling ball") || text4.Contains("rolling bead")) { spawnableInfo2.Type = SpawnType.Valuable; list.Add(spawnableInfo2); _spawnablesOthers.RemoveAt(num12); } } List list2 = new List(); HashSet hashSet3 = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (SpawnableInfo item4 in list) { if (item4 != null && !string.IsNullOrEmpty(item4.InternalName) && !hashSet3.Contains(item4.InternalName)) { hashSet3.Add(item4.InternalName); list2.Add(item4); } } list2.Sort(delegate(SpawnableInfo x, SpawnableInfo y) { int rollingBallScore = GetRollingBallScore(x.Name); int rollingBallScore2 = GetRollingBallScore(y.Name); return rollingBallScore.CompareTo(rollingBallScore2); }); _spawnablesValuables.InsertRange(0, list2); if ((Object)(object)ValuableDirector.instance != (Object)null && ValuableDirector.instance.cosmeticWorldObjectSetups != null) { _cachedCosmeticObjectSetups.Clear(); foreach (CosmeticWorldObjectSetup cosmeticWorldObjectSetup in ValuableDirector.instance.cosmeticWorldObjectSetups) { if (cosmeticWorldObjectSetup != null) { _cachedCosmeticObjectSetups.Add(cosmeticWorldObjectSetup); } } } List list3 = new List(); if (_cachedCosmeticObjectSetups.Count > 0) { foreach (CosmeticWorldObjectSetup cachedCosmeticObjectSetup in _cachedCosmeticObjectSetups) { if (cachedCosmeticObjectSetup != null && cachedCosmeticObjectSetup.prefab != null && ((PrefabRef)(object)cachedCosmeticObjectSetup.prefab).IsValid()) { string text6 = ""; Rarity rarity = cachedCosmeticObjectSetup.rarity; switch ((int)rarity) { case 0: text6 = (UseChinese() ? "普通" : "Common"); break; case 1: text6 = (UseChinese() ? "罕见" : "Uncommon"); break; case 2: text6 = (UseChinese() ? "稀有" : "Rare"); break; case 3: text6 = (UseChinese() ? "极度稀有" : "Ultra Rare"); break; } string name3 = (UseChinese() ? ("代币箱子 (" + text6 + ")") : ("Cosmetic Box (" + text6 + ")")); list3.Add(new SpawnableInfo { Name = name3, InternalName = ((PrefabRef)(object)cachedCosmeticObjectSetup.prefab).PrefabName, Type = SpawnType.Valuable, Source = cachedCosmeticObjectSetup.prefab, ExtraInfo = "" }); } } } _spawnablesCosmeticBoxes.AddRange(list3); try { EnemySetup[] array = Resources.FindObjectsOfTypeAll(); HashSet hashSet4 = new HashSet(StringComparer.OrdinalIgnoreCase); HashSet hashSet5 = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (SpawnableInfo spawnablesEnemy in _spawnablesEnemies) { if (spawnablesEnemy != null && !string.IsNullOrEmpty(spawnablesEnemy.InternalName)) { hashSet5.Add(spawnablesEnemy.InternalName); } } EnemySetup[] array2 = array; foreach (EnemySetup val2 in array2) { if ((Object)(object)val2 == (Object)null || string.IsNullOrEmpty(((Object)val2).name) || hashSet4.Contains(((Object)val2).name)) { continue; } hashSet4.Add(((Object)val2).name); if (hashSet5.Contains(((Object)val2).name)) { continue; } int num14 = -1; if (val2.spawnObjects != null) { foreach (PrefabRef spawnObject2 in val2.spawnObjects) { if (spawnObject2 != null && (Object)(object)((PrefabRef)(object)spawnObject2).Prefab != (Object)null) { EnemyHealth componentInChildren2 = ((PrefabRef)(object)spawnObject2).Prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { num14 = componentInChildren2.health; break; } } } } string extraInfo6 = ((num14 > 0) ? $"(HP: {num14})" : ""); string text7 = ((Object)val2).name.Replace("Enemy - ", "").Replace("Enemy ", ""); _spawnablesCustomEnemies.Add(new SpawnableInfo { Name = "[Mod] " + text7, InternalName = ((Object)val2).name, Type = SpawnType.Enemy, Source = val2, ExtraInfo = extraInfo6 }); } } catch (Exception arg) { Debug.LogError((object)$"[LoadAllSpawnables CustomEnemies Error]: {arg}"); } try { Item[] array3 = Resources.FindObjectsOfTypeAll(); HashSet hashSet6 = new HashSet(StringComparer.OrdinalIgnoreCase); HashSet hashSet7 = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (List item5 in new List> { _spawnablesMelee, _spawnablesRanged, _spawnablesOtherWeapons, _spawnablesCarts, _spawnablesVehicles, _spawnablesPotions, _spawnablesOthers, _spawnablesValuables }) { foreach (SpawnableInfo item6 in item5) { if (item6 != null && !string.IsNullOrEmpty(item6.InternalName)) { hashSet7.Add(item6.InternalName); } } } Item[] array4 = array3; foreach (Item val3 in array4) { if ((Object)(object)val3 == (Object)null || val3.prefab == null || string.IsNullOrEmpty(val3.itemName) || hashSet6.Contains(val3.itemName)) { continue; } hashSet6.Add(val3.itemName); if (!hashSet7.Contains(val3.itemName)) { int num15 = -1; int num16 = -1; if ((Object)(object)val3.value != (Object)null) { num15 = Mathf.RoundToInt(val3.value.valueMin); num16 = Mathf.RoundToInt(val3.value.valueMax); } string extraInfo7 = ""; if (num15 > 0) { extraInfo7 = ((num15 == num16) ? $"(${num15})" : $"(${num15}-{num16})"); } _spawnablesCustomItems.Add(new SpawnableInfo { Name = "[Mod] " + val3.itemName, InternalName = val3.itemName, Type = SpawnType.Other, Source = val3, ExtraInfo = extraInfo7 }); } } } catch (Exception arg2) { Debug.LogError((object)$"[LoadAllSpawnables CustomItems Error]: {arg2}"); } if (_spawnablesEnemies.Count > 0 || _spawnablesMelee.Count > 0 || _spawnablesRanged.Count > 0 || _spawnablesOtherWeapons.Count > 0 || _spawnablesValuables.Count > 0 || _spawnablesCarts.Count > 0 || _spawnablesVehicles.Count > 0 || _spawnablesPotions.Count > 0 || _spawnablesOthers.Count > 0 || _spawnablesCustomItems.Count > 0 || _spawnablesCustomEnemies.Count > 0 || _spawnablesDrones.Count > 0 || _spawnablesCosmeticBoxes.Count > 0) { _spawnablesLoaded = true; } } private static int GetRollingBallScore(string name) { if (string.IsNullOrEmpty(name)) { return 4; } if (name.IndexOf("Small", StringComparison.OrdinalIgnoreCase) >= 0 || name.Contains("小")) { return 1; } if (name.IndexOf("Medium", StringComparison.OrdinalIgnoreCase) >= 0 || name.Contains("中")) { return 2; } if (name.IndexOf("Large", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Big", StringComparison.OrdinalIgnoreCase) >= 0 || name.Contains("大")) { return 3; } return 4; } private static bool IsMultipleEnemy(SpawnableInfo info) { if (info == null) { return false; } string text = EnemyNameLocalizer.Translate(info.Name); if (!string.IsNullOrEmpty(text)) { Match match = Regex.Match(text, "\\s[xX](?\\d+)$"); if (match.Success && int.TryParse(match.Groups["num"].Value, out var result) && result >= 2) { return true; } } string input = info.Name ?? ""; if (Regex.IsMatch(input, "\\b[xX](?\\d+)\\b")) { Match match2 = Regex.Match(input, "\\b[xX](?\\d+)\\b"); if (match2.Success && int.TryParse(match2.Groups["num"].Value, out var result2) && result2 >= 2) { return true; } } Match match3 = Regex.Match(input, "^(Group - )?(?\\d+)\\s"); if (match3.Success && int.TryParse(match3.Groups["num"].Value, out var result3) && result3 >= 2) { return true; } Match match4 = Regex.Match(info.InternalName ?? "", "^(Enemy Group - |Group - |Enemy - |Enemy )?(?\\d+)\\s", RegexOptions.IgnoreCase); if (match4.Success && int.TryParse(match4.Groups["num"].Value, out var result4) && result4 >= 2) { return true; } return false; } public void ResetGlobalSettings() { if (_cfgModEnabled != null) { _cfgModEnabled.Value = true; } if (_cfgProhibitOthers != null) { _cfgProhibitOthers.Value = false; } if (_openKey != null) { _openKey.Value = "F4"; } ResetUpgradeSettings(); ((BaseUnityPlugin)this).Config.Save(); RebindOpenKey(); SyncProhibitOthersToRoom(); } public void ResetPlayerSettings() { if (_cfgAutoReviveTeammates != null) { _cfgAutoReviveTeammates.Value = false; } if (_cfgAutoReviveWhenSeen != null) { _cfgAutoReviveWhenSeen.Value = false; } if (_cfgReviveHeadOnTruck != null) { _cfgReviveHeadOnTruck.Value = true; } if (_cfgReviveHeadOnExtraction != null) { _cfgReviveHeadOnExtraction.Value = true; } if (_cfgReviveHeadOnCart != null) { _cfgReviveHeadOnCart.Value = true; } if (_cfgReviveAutoToTruck != null) { _cfgReviveAutoToTruck.Value = false; } if (_cfgDeathAutoToTruck != null) { _cfgDeathAutoToTruck.Value = false; } if (_cfgDeathAutoToExtraction != null) { _cfgDeathAutoToExtraction.Value = false; } if (_cfgAllTeammatesGodMode != null) { _cfgAllTeammatesGodMode.Value = false; } OnAllTeammatesGodModeChanged(enable: false); SaveRuntimeConfig(); } public void ResetVisualSettings() { if (_cfgCosmeticsEnabled != null) { _cfgCosmeticsEnabled.Value = true; } if (_cfgWingsAlwaysShow != null) { _cfgWingsAlwaysShow.Value = false; } if (_cfgFlipEnabled != null) { _cfgFlipEnabled.Value = false; } if (_cfgFlipShowToSelf != null) { _cfgFlipShowToSelf.Value = false; } if (_cfgEyeEffectEnabled != null) { _cfgEyeEffectEnabled.Value = false; } if (_cfgEyeEffect != null) { _cfgEyeEffect.Value = 2; } if (_cfgEyeBigPupil != null) { _cfgEyeBigPupil.Value = false; } if (_cfgEyePupilScaleAuto != null) { _cfgEyePupilScaleAuto.Value = false; } if (_cfgEyePupilScaleSpeed != null) { _cfgEyePupilScaleSpeed.Value = 0.3f; } if (_cfgEyeColorMode != null) { _cfgEyeColorMode.Value = 0; } if (_cfgEyeSingleColor != null) { _cfgEyeSingleColor.Value = 2; } if (_cfgEyeMultiSelectRed != null) { _cfgEyeMultiSelectRed.Value = true; } if (_cfgEyeMultiSelectGreen != null) { _cfgEyeMultiSelectGreen.Value = true; } if (_cfgEyeMultiSelectOrange != null) { _cfgEyeMultiSelectOrange.Value = false; } if (_cfgEyeMultiSelectLove != null) { _cfgEyeMultiSelectLove.Value = false; } if (_cfgEyeMultiSelectInverted != null) { _cfgEyeMultiSelectInverted.Value = false; } if (_cfgEyeSwapInterval != null) { _cfgEyeSwapInterval.Value = 1f; } if (_cfgFlashlightColorEnabled != null) { _cfgFlashlightColorEnabled.Value = false; } if (_cfgFlashlightColor != null) { _cfgFlashlightColor.Value = 0; } if (_cfgSpinEnabled != null) { _cfgSpinEnabled.Value = false; } if (_cfgSpinDirection != null) { _cfgSpinDirection.Value = 1; } if (_cfgSpinSpeed != null) { _cfgSpinSpeed.Value = 0.3f; } if (_cfgSpinShowToSelf != null) { _cfgSpinShowToSelf.Value = false; } if (_cfgSpinFreeze != null) { _cfgSpinFreeze.Value = false; } if (_cfgSpinAxis != null) { _cfgSpinAxis.Value = 1; } if (_cfgSpinRadius != null) { _cfgSpinRadius.Value = 0f; } if (_cfgEnableWingsSound != null) { _cfgEnableWingsSound.Value = false; } if (_cfgTumbleFlyEnabled != null) { _cfgTumbleFlyEnabled.Value = false; } if (_cfgJumpMultiplierEnabled != null) { _cfgJumpMultiplierEnabled.Value = false; } if (_cfgJumpMultiplier != null) { _cfgJumpMultiplier.Value = 1.5f; } if (_cfgInfiniteStamina != null) { _cfgInfiniteStamina.Value = true; } if (_cfgInfiniteWeaponBattery != null) { _cfgInfiniteWeaponBattery.Value = false; } if (_cfgInfiniteChargingStation != null) { _cfgInfiniteChargingStation.Value = true; } if (_cfgChargingStationHeal != null) { _cfgChargingStationHeal.Value = true; } if (_cfgInfBatteryMelee != null) { _cfgInfBatteryMelee.Value = true; } if (_cfgInfBatteryRanged != null) { _cfgInfBatteryRanged.Value = true; } if (_cfgInfBatteryVehicles != null) { _cfgInfBatteryVehicles.Value = true; } if (_cfgInfBatteryDrones != null) { _cfgInfBatteryDrones.Value = true; } if (_cfgInfBatteryTools != null) { _cfgInfBatteryTools.Value = true; } if (_cfgRemovePillarLimit != null) { _cfgRemovePillarLimit.Value = true; } if (_cfgPillarDropMultiplierEnabled != null) { _cfgPillarDropMultiplierEnabled.Value = true; } if (_cfgPillarDropMultiplier != null) { _cfgPillarDropMultiplier.Value = 1; } if (_cfgTeammateDeathDropBead != null) { _cfgTeammateDeathDropBead.Value = false; } if (_cfgTeammateReviveDropBead != null) { _cfgTeammateReviveDropBead.Value = false; } if (_cfgLimitCosmeticBoxes != null) { _cfgLimitCosmeticBoxes.Value = true; } if (_cfgLimitCosmeticBoxesValue != null) { _cfgLimitCosmeticBoxesValue.Value = 11; } if (_cfgWingsColorIndex != null) { _cfgWingsColorIndex.Value = 2; } if (_cfgValuableGodMode != null) { _cfgValuableGodMode.Value = false; } if (_cfgValuableGodModeBead != null) { _cfgValuableGodModeBead.Value = false; } if (_cfgValuableGodModeWeapon != null) { _cfgValuableGodModeWeapon.Value = false; } if (_cfgValuableGodModeVehicle != null) { _cfgValuableGodModeVehicle.Value = false; } if (_cfgValuableGodModeCosmetic != null) { _cfgValuableGodModeCosmetic.Value = false; } if (_cfgValuableGodModePotion != null) { _cfgValuableGodModePotion.Value = false; } if (_cfgValuableGodModeBattery != null) { _cfgValuableGodModeBattery.Value = false; } if (_cfgValuableGodModeMoneyBag != null) { _cfgValuableGodModeMoneyBag.Value = false; } UpdateValuablesGodModeState(forceDisableAll: true); if (_cfgWingsShowFrequency != null) { _cfgWingsShowFrequency.Value = 0; } if (_cfgThirdPersonEnabled != null) { _cfgThirdPersonEnabled.Value = false; } if (_cfgThirdPersonDistance != null) { _cfgThirdPersonDistance.Value = 2.2f; } if (_cfgThirdPersonHeight != null) { _cfgThirdPersonHeight.Value = 0.5f; } if (_cfgThirdPersonModelScale != null) { _cfgThirdPersonModelScale.Value = 0.8f; } if (_cfgThirdPersonHorizontal != null) { _cfgThirdPersonHorizontal.Value = 0f; } if (_cfgGodModeFlightEnabled != null) { _cfgGodModeFlightEnabled.Value = false; } _itemTeleportValuable = true; _itemTeleportBead = true; _itemTeleportWeapon = false; _itemTeleportVehicle = false; _itemTeleportCosmetic = true; _itemTeleportPotion = true; _itemTeleportBattery = true; _itemTeleportMoneyBag = true; _itemTeleportCountSlider = 11f; _itemTeleportInterval = 0.3f; _isTeleporting = false; _activeTeleportCoroutines = 0; _itemExcludeTruckAndExtraction = true; _teleportTotalCount = 0; _teleportCurrentIndex = 0; _teleportStatusText = ""; if ((Object)(object)PlayerAvatar.instance != (Object)null) { SetPlayerFlightGodMode(PlayerAvatarSteamIDRef.Invoke(PlayerAvatar.instance), enable: false); } _flightGodModePlayers.Clear(); SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } public void ResetMonsterData() { _globalDespawnMin = _originalDespawnMin; _globalDespawnMax = _originalDespawnMax; _globalSpawnMin = _originalSpawnMin; _globalSpawnMax = _originalSpawnMax; _globalOverrideInited = true; if (_cfgSpawnRateMultiplier != null) { _cfgSpawnRateMultiplier.Value = 1f; } if (_cfgResetMonsterDataOnLevelLoad != null) { _cfgResetMonsterDataOnLevelLoad.Value = true; } if (_cfgLimitActionAndOvercharge != null) { _cfgLimitActionAndOvercharge.Value = false; } if (_cfgEnemyPullInterval != null) { _cfgEnemyPullInterval.Value = 0.1f; } if (_cfgEnemyPullDistance != null) { _cfgEnemyPullDistance.Value = 3f; } if ((Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item != (Object)null) { item.DespawnedTimeMin = _globalDespawnMin; item.DespawnedTimeMax = _globalDespawnMax; item.SpawnedTimeMin = _globalSpawnMin; item.SpawnedTimeMax = _globalSpawnMax; } } } SaveRuntimeConfig(); } public static Vector3 CheckWallObstacle(Vector3 startPos, Vector3 targetPos, float radius = 0.4f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0018: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPos - startPos; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.1f) { return targetPos; } ((Vector3)(ref val)).Normalize(); int num = ~LayerMask.GetMask(new string[2] { "Player", "Ignore Raycast" }); RaycastHit val2 = default(RaycastHit); if (Physics.SphereCast(startPos, radius, val, ref val2, magnitude, num, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * (radius + 0.05f); } return targetPos; } public static Vector3 FixPositionIfWall(Vector3 targetPos, float radius = 0.4f) { //IL_002d: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_008f: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_00e4: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) int num = ~LayerMask.GetMask(new string[4] { "Player", "Ignore Raycast", "Trigger", "UI" }); if (Physics.OverlapSphere(targetPos, radius, num, (QueryTriggerInteraction)1).Length == 0) { return targetPos; } Vector3[] obj = new Vector3[10] { Vector3.up, Vector3.forward, Vector3.back, Vector3.left, Vector3.right, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3) }; Vector3 val = Vector3.forward + Vector3.left; obj[5] = ((Vector3)(ref val)).normalized; val = Vector3.forward + Vector3.right; obj[6] = ((Vector3)(ref val)).normalized; val = Vector3.back + Vector3.left; obj[7] = ((Vector3)(ref val)).normalized; val = Vector3.back + Vector3.right; obj[8] = ((Vector3)(ref val)).normalized; obj[9] = Vector3.down; Vector3[] array = (Vector3[])(object)obj; for (float num2 = 0.3f; num2 <= 1.5f; num2 += 0.3f) { Vector3[] array2 = array; foreach (Vector3 val2 in array2) { Vector3 val3 = targetPos + val2 * num2; if (Physics.OverlapSphere(val3, radius, num, (QueryTriggerInteraction)1).Length == 0) { return val3; } } } return targetPos; } public static Vector3 GetSpawnPosition(float distance = 2f, float upOffset = 0.5f) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00f1: 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_007e: 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) if ((Object)(object)PlayerController.instance == (Object)null) { return Vector3.zero; } bool flag = false; try { PlayerAvatar val = (((Object)(object)PlayerController.instance.playerAvatarScript != (Object)null) ? ((Component)PlayerController.instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val != (Object)null) { flag = PlayerAvatarDeadSetRef.Invoke(val); } } catch { } if (flag && (Object)(object)GetMainCamera() != (Object)null) { return ((Component)GetMainCamera()).transform.position + ((Component)GetMainCamera()).transform.forward * (distance + 1f); } _ = ((Component)PlayerController.instance).transform.position + Vector3.up * upOffset; return ((Component)PlayerController.instance).transform.position + ((Component)PlayerController.instance).transform.forward * distance + Vector3.up * upOffset; } public static Quaternion GetSpawnRotation() { //IL_000d: 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_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerController.instance == (Object)null) { return Quaternion.identity; } bool flag = false; try { PlayerAvatar val = (((Object)(object)PlayerController.instance.playerAvatarScript != (Object)null) ? ((Component)PlayerController.instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val != (Object)null) { flag = PlayerAvatarDeadSetRef.Invoke(val); } } catch { } if (flag && (Object)(object)GetMainCamera() != (Object)null) { return ((Component)GetMainCamera()).transform.rotation; } return ((Component)PlayerController.instance).transform.rotation; } private IEnumerator SpawnCoroutine(SpawnableInfo info, int totalCount) { if (info == null) { yield break; } if ((Object)(object)RunManager.instance != (Object)null && RunManagerLevelIsShopRef.Invoke(RunManager.instance)) { EnsureSafeDirectorsForShop(); } bool isMultiplayer = SemiFunc.IsMultiplayer(); for (int count = 0; count < totalCount; count++) { if ((Object)(object)PlayerController.instance == (Object)null) { break; } Vector3 spawnPosition = GetSpawnPosition((_cfgSpawnDistance != null) ? _cfgSpawnDistance.Value : 3f); Quaternion spawnRotation = GetSpawnRotation(); try { if (info.Type == SpawnType.Enemy) { object source = info.Source; EnemySetup val = (EnemySetup)((source is EnemySetup) ? source : null); if ((Object)(object)val != (Object)null && val.spawnObjects != null) { foreach (PrefabRef spawnObject in val.spawnObjects) { if (spawnObject == null || !((PrefabRef)(object)spawnObject).IsValid()) { continue; } GameObject val2 = null; try { if (isMultiplayer) { val2 = (PhotonNetwork.IsMasterClient ? PhotonNetwork.InstantiateRoomObject(((PrefabRef)(object)spawnObject).ResourcePath, spawnPosition, Quaternion.identity, (byte)0, (object[])null) : PhotonNetwork.Instantiate(((PrefabRef)(object)spawnObject).ResourcePath, spawnPosition, Quaternion.identity, (byte)0, (object[])null)); } } catch (Exception ex) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)("[SpawnObject Enemy Network Fail, Fallback to local]: " + ex.Message)); } } if ((Object)(object)val2 == (Object)null && (Object)(object)((PrefabRef)(object)spawnObject).Prefab != (Object)null) { val2 = Object.Instantiate(((PrefabRef)(object)spawnObject).Prefab, spawnPosition, Quaternion.identity); } if (!((Object)(object)val2 != (Object)null)) { continue; } val2.AddComponent(); EnemyParent component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { EnemyParentSetupDoneRef.Invoke(component) = true; Enemy componentInChildren = val2.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.EnemyTeleported(spawnPosition); } EnemyParentFirstSpawnPointUsedRef.Invoke(component) = true; if (_cfgSpawnedDelayPull) { ((MonoBehaviour)Instance).StartCoroutine(Instance.DelayTeleportToPlayerCoroutine(component)); } } } } } else if (info.Type == SpawnType.Weapon || info.Type == SpawnType.Cart || info.Type == SpawnType.Vehicle || info.Type == SpawnType.Other) { object source2 = info.Source; Item val3 = (Item)((source2 is Item) ? source2 : null); if ((Object)(object)val3 != (Object)null && val3.prefab != null) { GameObject val4 = null; try { if (isMultiplayer) { val4 = (PhotonNetwork.IsMasterClient ? PhotonNetwork.InstantiateRoomObject(((PrefabRef)(object)val3.prefab).ResourcePath, spawnPosition, spawnRotation, (byte)0, (object[])null) : PhotonNetwork.Instantiate(((PrefabRef)(object)val3.prefab).ResourcePath, spawnPosition, spawnRotation, (byte)0, (object[])null)); } } catch (Exception ex2) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)("[SpawnObject Item Network Fail, Fallback to local]: " + ex2.Message)); } } if ((Object)(object)val4 == (Object)null && (Object)(object)((PrefabRef)(object)val3.prefab).Prefab != (Object)null) { Object.Instantiate(((PrefabRef)(object)val3.prefab).Prefab, spawnPosition, spawnRotation); } } } else if (info.Type == SpawnType.Valuable) { object source3 = info.Source; PrefabRef val5 = (PrefabRef)((source3 is PrefabRef) ? source3 : null); object source4 = info.Source; Item val6 = (Item)((source4 is Item) ? source4 : null); if (val5 == null && (Object)(object)val6 != (Object)null) { val5 = val6.prefab; } if (val5 != null && ((PrefabRef)(object)val5).IsValid()) { GameObject val7 = null; try { if (isMultiplayer) { val7 = (PhotonNetwork.IsMasterClient ? PhotonNetwork.InstantiateRoomObject(((PrefabRef)(object)val5).ResourcePath, spawnPosition, spawnRotation, (byte)0, (object[])null) : PhotonNetwork.Instantiate(((PrefabRef)(object)val5).ResourcePath, spawnPosition, spawnRotation, (byte)0, (object[])null)); } } catch (Exception ex3) { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogWarning((object)("[SpawnObject Valuable Network Fail, Fallback to local]: " + ex3.Message)); } } if ((Object)(object)val7 == (Object)null && (Object)(object)((PrefabRef)(object)val5).Prefab != (Object)null) { val7 = Object.Instantiate(((PrefabRef)(object)val5).Prefab, spawnPosition, spawnRotation); } if ((Object)(object)val7 == (Object)null) { GameObject val8 = null; if (info.InternalName.Equals("enemyValuableSmall", StringComparison.OrdinalIgnoreCase)) { val8 = AssetManager.instance?.enemyValuableSmall; } else if (info.InternalName.Equals("enemyValuableMedium", StringComparison.OrdinalIgnoreCase)) { val8 = AssetManager.instance?.enemyValuableMedium; } else if (info.InternalName.Equals("enemyValuableBig", StringComparison.OrdinalIgnoreCase)) { val8 = AssetManager.instance?.enemyValuableBig; } if ((Object)(object)val8 != (Object)null) { val7 = Object.Instantiate(val8, spawnPosition, spawnRotation); } } if ((Object)(object)val7 != (Object)null) { ValuableObject component2 = val7.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.DollarValueSetLogic(); } } } } } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"[SpawnObject Coroutine Error]: Failed to spawn {info.Name} at index {count}. Exception: {arg}"); } if (count < totalCount - 1) { yield return (object)new WaitForSecondsRealtime(0.1f); } } } public static void SpawnObject(SpawnableInfo info) { if (info == null || (Object)(object)PlayerController.instance == (Object)null || (Object)(object)Instance == (Object)null) { return; } try { ((MonoBehaviour)Instance).StartCoroutine(Instance.SpawnCoroutine(info, _spawnCount)); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogError((object)$"[SpawnObject StartCoroutine Error]: Failed to start spawn coroutine for {info.Name}. Exception: {arg}"); } } } private IEnumerator DelayTeleportToPlayerCoroutine(EnemyParent enemyParent) { if ((Object)(object)enemyParent == (Object)null) { yield break; } float timeout = 5f; while ((Object)(object)enemyParent != (Object)null && EnemyParentSpawnedRef.Invoke(enemyParent) && timeout > 0f) { timeout -= Time.deltaTime; yield return null; } timeout = 30f; while ((Object)(object)enemyParent != (Object)null && !EnemyParentSpawnedRef.Invoke(enemyParent) && timeout > 0f) { timeout -= Time.deltaTime; yield return null; } if (!((Object)(object)enemyParent != (Object)null) || !EnemyParentSpawnedRef.Invoke(enemyParent) || !((Object)(object)PlayerController.instance != (Object)null)) { yield break; } yield return (object)new WaitForSeconds(0.2f); if (!((Object)(object)enemyParent != (Object)null) || !EnemyParentSpawnedRef.Invoke(enemyParent) || !((Object)(object)PlayerController.instance != (Object)null)) { yield break; } Vector3 spawnPosition = GetSpawnPosition(6f); Enemy componentInChildren = ((Component)enemyParent).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null)) { yield break; } try { componentInChildren.EnemyTeleported(spawnPosition); } catch { } } public static T FindComponentInHierarchy(Component comp) where T : Component { if ((Object)(object)comp == (Object)null) { return default(T); } T component = comp.GetComponent(); if ((Object)(object)component != (Object)null) { return component; } component = comp.GetComponentInParent(); if ((Object)(object)component != (Object)null) { return component; } return comp.GetComponentInChildren(); } public static void UpdateValuablesGodModeState(bool forceDisableAll = false) { if ((Object)(object)Instance == (Object)null) { return; } bool flag = !forceDisableAll && IsValuableGodModeValuableEnabled(); bool flag2 = !forceDisableAll && IsValuableGodModeBeadEnabled(); bool flag3 = !forceDisableAll && IsValuableGodModeWeaponEnabled(); bool flag4 = !forceDisableAll && IsValuableGodModeVehicleEnabled(); bool flag5 = !forceDisableAll && IsValuableGodModeMoneyBagEnabled(); bool flag6 = !forceDisableAll && IsValuableGodModeHealPackEnabled(); List list = new List(); if ((Object)(object)ValuableDirector.instance != (Object)null && ValuableDirector.instance.valuableList != null) { list.AddRange(ValuableDirector.instance.valuableList); } ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val in array) { if ((Object)(object)val != (Object)null && !list.Contains(val)) { list.Add(val); } } foreach (ValuableObject item in list) { if (!((Object)(object)item == (Object)null)) { PhysGrabObjectImpactDetector component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null) { bool flag7 = IsBead(item); bool flag8 = IsMoneyBag(item); DetectorIsIndestructibleRef.Invoke(component) = (flag7 ? flag2 : (flag8 ? flag5 : flag)); } } } ItemEquippable[] array2 = Object.FindObjectsOfType(); foreach (ItemEquippable val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { PhysGrabObjectImpactDetector val3 = Plugin.FindComponentInHierarchy((Component)(object)val2); if ((Object)(object)val3 != (Object)null) { DetectorIsIndestructibleRef.Invoke(val3) = flag3; } } } ItemVehicle[] array3 = Object.FindObjectsOfType(); foreach (ItemVehicle val4 in array3) { if (!((Object)(object)val4 == (Object)null)) { PhysGrabObjectImpactDetector val5 = Plugin.FindComponentInHierarchy((Component)(object)val4); if ((Object)(object)val5 != (Object)null) { DetectorIsIndestructibleRef.Invoke(val5) = flag4; } } } PhysGrabCart[] array4 = Object.FindObjectsOfType(); foreach (PhysGrabCart val6 in array4) { if (!((Object)(object)val6 == (Object)null)) { PhysGrabObjectImpactDetector val7 = Plugin.FindComponentInHierarchy((Component)(object)val6); if ((Object)(object)val7 != (Object)null) { DetectorIsIndestructibleRef.Invoke(val7) = flag4; } } } bool flag9 = !forceDisableAll && IsValuableGodModeCosmeticEnabled(); CosmeticWorldObject[] array5 = Object.FindObjectsOfType(); foreach (CosmeticWorldObject val8 in array5) { if (!((Object)(object)val8 == (Object)null)) { PhysGrabObjectImpactDetector val9 = Plugin.FindComponentInHierarchy((Component)(object)val8); if ((Object)(object)val9 != (Object)null) { DetectorIsIndestructibleRef.Invoke(val9) = flag9; } } } bool flag10 = !forceDisableAll && IsValuableGodModePotionEnabled(); bool flag11 = !forceDisableAll && IsValuableGodModeBatteryEnabled(); PhysGrabObject[] array6 = Object.FindObjectsOfType(); foreach (PhysGrabObject val10 in array6) { if ((Object)(object)val10 == (Object)null) { continue; } string text = ((Object)val10).name.ToLower(); bool flag12 = text.Contains("upgrade"); bool flag13 = (text.Contains("potion") || text.Contains("syringe") || text.Contains("medicine") || text.Contains("heal")) && !text.Contains("upgrade"); bool flag14 = text.Contains("battery"); if (flag12 || flag13 || flag14) { PhysGrabObjectImpactDetector val11 = Plugin.FindComponentInHierarchy((Component)(object)val10); if ((Object)(object)val11 != (Object)null) { DetectorIsIndestructibleRef.Invoke(val11) = (flag12 ? flag10 : (flag13 ? flag6 : flag11)); } } } } public static bool IsObjectInCartOrVehicle(PhysGrabObject phys) { if ((Object)(object)phys == (Object)null) { return false; } PhysGrabCart componentInParent = ((Component)phys).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)((Component)componentInParent).gameObject != (Object)(object)((Component)phys).gameObject) { return true; } ItemVehicle componentInParent2 = ((Component)phys).GetComponentInParent(); if ((Object)(object)componentInParent2 != (Object)null && (Object)(object)((Component)componentInParent2).gameObject != (Object)(object)((Component)phys).gameObject) { return true; } try { PhysGrabCart[] array = Object.FindObjectsOfType(); foreach (PhysGrabCart val in array) { if ((Object)(object)val == (Object)null || (Object)(object)((Component)val).gameObject == (Object)(object)((Component)phys).gameObject || !((Object)(object)val.physGrabInCart != (Object)null)) { continue; } IList list = PhysGrabInCartInCartObjectsRef.Invoke(val.physGrabInCart); if (list == null) { continue; } foreach (object item in list) { if (item != null) { if (_cartObjectPhysGrabField == null) { _cartObjectPhysGrabField = item.GetType().GetField("physGrabObject", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_cartObjectPhysGrabField != null && (Object)/*isinst with value type is only supported in some contexts*/ == (Object)(object)phys) { return true; } } } } } catch (Exception ex) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)("[GameTools] IsObjectInCartOrVehicle check failed: " + ex.Message)); } } return false; } public static bool IsObjectInHaulList(PhysGrabObject phys) { if ((Object)(object)phys == (Object)null) { return false; } try { if ((Object)(object)RoundDirector.instance == (Object)null) { return false; } List dollarHaulList = RoundDirector.instance.dollarHaulList; if (dollarHaulList == null || dollarHaulList.Count == 0) { return false; } if (dollarHaulList.Contains(((Component)phys).gameObject)) { return true; } if ((Object)(object)((Component)phys).transform.root != (Object)null && dollarHaulList.Contains(((Component)((Component)phys).transform.root).gameObject)) { return true; } ValuableObject component = ((Component)phys).GetComponent(); if ((Object)(object)component != (Object)null && dollarHaulList.Contains(((Component)component).gameObject)) { return true; } foreach (GameObject item in dollarHaulList) { if (!((Object)(object)item == (Object)null)) { if ((Object)(object)((Component)phys).gameObject == (Object)(object)item || ((Component)phys).transform.IsChildOf(item.transform)) { return true; } if ((Object)(object)component != (Object)null && ((Object)(object)((Component)component).gameObject == (Object)(object)item || ((Component)component).transform.IsChildOf(item.transform))) { return true; } } } } catch (Exception ex) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)("[GameTools] IsObjectInHaulList check error: " + ex.Message)); } } return false; } public static bool IsObjectExcludedFromTeleport(PhysGrabObject phys) { if ((Object)(object)phys == (Object)null) { return false; } if ((Object)(object)Instance != (Object)null && Instance._itemExcludeTruckAndExtraction) { if (IsObjectInHaulList(phys)) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[GameTools] Excluded item '" + ((Object)phys).name + "' from teleport because it is in Haul List (already secured).")); return true; } if (IsObjectInCartOrVehicle(phys)) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[GameTools] Excluded item '" + ((Object)phys).name + "' from teleport because it is in Cart or Vehicle.")); return true; } } return false; } public static List GetObjectsByType(string type) { List list = new List(); if (type.Equals("valuable", StringComparison.OrdinalIgnoreCase)) { ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val in array) { if (!((Object)(object)val == (Object)null) && !IsBead(val) && !IsMoneyBag(val)) { PhysGrabObject val2 = ValuablePhysGrabObjectRef.Invoke(val); PhysGrabObject val3 = (((Object)(object)val2 != (Object)null) ? val2 : ((Component)val).GetComponent()); if ((Object)(object)val3 != (Object)null && !list.Contains(val3) && !IsObjectExcludedFromTeleport(val3)) { list.Add(val3); } } } } else if (type.Equals("moneybag", StringComparison.OrdinalIgnoreCase)) { ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val4 in array) { if (!((Object)(object)val4 == (Object)null) && IsMoneyBag(val4)) { PhysGrabObject val5 = ValuablePhysGrabObjectRef.Invoke(val4); PhysGrabObject val6 = (((Object)(object)val5 != (Object)null) ? val5 : ((Component)val4).GetComponent()); if ((Object)(object)val6 != (Object)null && !list.Contains(val6) && !IsObjectExcludedFromTeleport(val6)) { list.Add(val6); } } } } else if (type.Equals("bead", StringComparison.OrdinalIgnoreCase)) { ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val7 in array) { if (!((Object)(object)val7 == (Object)null) && IsBead(val7)) { PhysGrabObject val8 = ValuablePhysGrabObjectRef.Invoke(val7); PhysGrabObject val9 = (((Object)(object)val8 != (Object)null) ? val8 : ((Component)val7).GetComponent()); if ((Object)(object)val9 != (Object)null && !list.Contains(val9) && !IsObjectExcludedFromTeleport(val9)) { list.Add(val9); } } } } else if (type.Equals("weapon", StringComparison.OrdinalIgnoreCase)) { ItemEquippable[] array2 = Object.FindObjectsOfType(); foreach (ItemEquippable val10 in array2) { if ((Object)(object)val10 == (Object)null) { continue; } try { if (!ItemEquippableIsEquippedRef.Invoke(val10)) { PhysGrabObject component = ((Component)val10).GetComponent(); if ((Object)(object)component != (Object)null && !list.Contains(component)) { list.Add(component); } } } catch { } } } else if (type.Equals("vehicle", StringComparison.OrdinalIgnoreCase)) { ItemVehicle[] array3 = Object.FindObjectsOfType(); foreach (ItemVehicle val11 in array3) { if (!((Object)(object)val11 == (Object)null)) { PhysGrabObject component2 = ((Component)val11).GetComponent(); if ((Object)(object)component2 != (Object)null && !list.Contains(component2)) { list.Add(component2); } } } PhysGrabCart[] array4 = Object.FindObjectsOfType(); foreach (PhysGrabCart val12 in array4) { if ((Object)(object)val12 == (Object)null) { continue; } try { PhysGrabObject val13 = PhysGrabCartPhysGrabObjectRef.Invoke(val12); PhysGrabObject val14 = (((Object)(object)val13 != (Object)null) ? val13 : ((Component)val12).GetComponent()); if ((Object)(object)val14 != (Object)null && !list.Contains(val14)) { list.Add(val14); } } catch { } } } else if (type.Equals("cosmetic", StringComparison.OrdinalIgnoreCase)) { CosmeticWorldObject[] array5 = Object.FindObjectsOfType(); foreach (CosmeticWorldObject val15 in array5) { if (!((Object)(object)val15 == (Object)null)) { PhysGrabObject component3 = ((Component)val15).GetComponent(); if ((Object)(object)component3 != (Object)null && !list.Contains(component3)) { list.Add(component3); } } } } else if (type.Equals("potion", StringComparison.OrdinalIgnoreCase)) { PhysGrabObject[] array6 = Object.FindObjectsOfType(); foreach (PhysGrabObject val16 in array6) { if (!((Object)(object)val16 == (Object)null) && ((Object)val16).name.ToLower().Contains("upgrade") && !list.Contains(val16) && !IsObjectExcludedFromTeleport(val16)) { list.Add(val16); } } } else if (type.Equals("healpack", StringComparison.OrdinalIgnoreCase)) { PhysGrabObject[] array6 = Object.FindObjectsOfType(); foreach (PhysGrabObject val17 in array6) { if (!((Object)(object)val17 == (Object)null)) { string text = ((Object)val17).name.ToLower(); if ((text.Contains("potion") || text.Contains("syringe") || text.Contains("medicine") || text.Contains("heal")) && !text.Contains("upgrade") && !list.Contains(val17) && !IsObjectExcludedFromTeleport(val17)) { list.Add(val17); } } } } return list; } private static bool IsBead(ValuableObject vo) { if ((Object)(object)vo == (Object)null) { return false; } string text = ((Object)vo).name.ToLower(); if (!text.Contains("enemyvaluable") && !text.Contains("enemy valuable") && !text.Contains("rolling ball")) { return text.Contains("rolling bead"); } return true; } private static bool IsMoneyBag(ValuableObject vo) { if ((Object)(object)vo == (Object)null) { return false; } string text = ((Object)vo).name.ToLower(); if (!text.Contains("surplusvaluable") && !text.Contains("moneybag")) { return text.Contains("money_bag"); } return true; } public static Vector3 GetExtractionPointInteractionPosition(ExtractionPoint ep) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ep == (Object)null) { return Vector3.zero; } return ((Component)ep).transform.position + Vector3.up * 3f; } public static ExtractionPoint GetAnyActiveExtractionPoint() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 try { ExtractionPoint[] array = Object.FindObjectsOfType(); List list = new List(); List list2 = new List(); ExtractionPoint[] array2 = array; foreach (ExtractionPoint val in array2) { if (!((Object)(object)val == (Object)null) && !ExtractionPointIsShopRef.Invoke(val)) { State val2 = ExtractionPointCurrentStateRef.Invoke(val); if ((int)val2 == 2 || (int)val2 == 6 || (int)val2 == 4) { list.Add(val); } else { list2.Add(val); } } } if (list.Count > 0) { return list[Random.Range(0, list.Count)]; } if (list2.Count > 0) { return list2[Random.Range(0, list2.Count)]; } } catch { } return null; } public static Vector3 GetExtractionPointButtonPosition(ExtractionPoint ep) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0067: 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_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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a1: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ep == (Object)null) { return Vector3.zero; } try { Vector3 position = ((Component)ep).transform.position; Vector3 val = position; bool flag = false; if ((Object)(object)ep.button != (Object)null) { val = ((Component)ep.button).transform.position; flag = true; } else if ((Object)(object)ep.buttonGrabObject != (Object)null) { val = ((Component)ep.buttonGrabObject).transform.position; flag = true; } if (flag) { Vector3 val2 = val - position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude > 0.01f) { ((Vector3)(ref val2)).Normalize(); Vector3 result = val + val2 * 0.5f; result.y = position.y + 0.2f; return result; } } } catch { } return ((Component)ep).transform.position + Vector3.up * 0.5f; } public static Vector3 GetAnyExtractionPointPosition() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 try { ExtractionPoint[] array = Object.FindObjectsOfType(); List list = new List(); List list2 = new List(); ExtractionPoint[] array2 = array; foreach (ExtractionPoint val in array2) { if (!((Object)(object)val == (Object)null) && !ExtractionPointIsShopRef.Invoke(val)) { State val2 = ExtractionPointCurrentStateRef.Invoke(val); if ((int)val2 == 2 || (int)val2 == 6 || (int)val2 == 4) { list.Add(val); } else { list2.Add(val); } } } if (list.Count > 0) { return GetExtractionPointInteractionPosition(list[Random.Range(0, list.Count)]); } if (list2.Count > 0) { return GetExtractionPointInteractionPosition(list2[Random.Range(0, list2.Count)]); } } catch { } return Vector3.zero; } public static Vector3 GetRandomExtractionPointPosition() { //IL_00ee: 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_00c1: 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_00c8: 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) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_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_0088: 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_0092: 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_003c: Invalid comparison between Unknown and I4 //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 try { ExtractionPoint[] array = Object.FindObjectsOfType(); List list = new List(); ExtractionPoint[] array2 = array; foreach (ExtractionPoint val in array2) { if (!((Object)(object)val == (Object)null)) { State val2 = ExtractionPointCurrentStateRef.Invoke(val); if (!ExtractionPointIsShopRef.Invoke(val) && ((int)val2 == 2 || (int)val2 == 6 || (int)val2 == 4)) { list.Add(val); } } } if (list.Count > 0) { return ((Component)list[Random.Range(0, list.Count)]).transform.position + Vector3.up * 1.5f; } } catch { } if ((Object)(object)PlayerController.instance != (Object)null) { Vector3 position = ((Component)PlayerController.instance).transform.position; Vector3 forward = ((Component)PlayerController.instance).transform.forward; return position + forward * 2f + Vector3.up * 0.5f; } return Vector3.zero; } public static bool IsPositionNearExtractionPoint(Vector3 pos, float threshold = 20f) { //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_0024: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) try { ExtractionPoint[] array = Object.FindObjectsOfType(); if (array != null) { ExtractionPoint[] array2 = array; foreach (ExtractionPoint val in array2) { if (!((Object)(object)val == (Object)null)) { Vector3 extractionPointInteractionPosition = GetExtractionPointInteractionPosition(val); if (extractionPointInteractionPosition != Vector3.zero && Vector3.Distance(pos, extractionPointInteractionPosition) < threshold) { return true; } } } } } catch { } return false; } private IEnumerator TeleportObjectsWithTemporaryGodModeCoroutine(List objects, Func getTargetPosFunc) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[GameTools] TeleportObjectsCoroutine: Received {objects?.Count ?? 0} objects."); if (objects == null || objects.Count == 0) { yield break; } _cancelTeleportRequested = false; StartTeleportJob(); List cartsToTeleport = new List(); List cartPhysObjs = new List(); for (int num = objects.Count - 1; num >= 0; num--) { PhysGrabObject val = objects[num]; if (!((Object)(object)val == (Object)null)) { PhysGrabCart component = ((Component)val).GetComponent(); ItemVehicle component2 = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { cartsToTeleport.Add(component); cartPhysObjs.Add(val); objects.RemoveAt(num); } else if ((Object)(object)component2 != (Object)null) { cartPhysObjs.Add(val); objects.RemoveAt(num); } } } List allCartItems = new List(); foreach (PhysGrabCart item in cartsToTeleport) { try { List list = ItemsInCartRef.Invoke(item); if (list == null) { continue; } foreach (PhysGrabObject item2 in list) { if ((Object)(object)item2 != (Object)null && !allCartItems.Contains(item2)) { allCartItems.Add(item2); } } } catch { } } int num2 = Mathf.RoundToInt(_itemTeleportCountSlider); if (num2 < 11 && objects.Count > num2) { objects = objects.GetRange(0, num2); } _teleportTotalCount = allCartItems.Count + objects.Count + cartPhysObjs.Count; _teleportCurrentIndex = 0; _teleportStatusText = (UseChinese() ? "传送物品中" : "Teleporting Items"); List allProtectedObjects = new List(); int count = 0; try { int i; if (allCartItems.Count > 0) { _teleportStatusText = (UseChinese() ? "清理推车中" : "Clearing Carts"); SetGodModeForObjects(allCartItems, enable: true); allProtectedObjects.AddRange(allCartItems); for (i = 0; i < allCartItems.Count; i++) { if (_cancelTeleportRequested) { break; } PhysGrabObject val2 = allCartItems[i]; if ((Object)(object)val2 == (Object)null) { continue; } Vector3 randomExtractionPointPosition = GetRandomExtractionPointPosition(); if (randomExtractionPointPosition != Vector3.zero) { try { val2.Teleport(randomExtractionPointPosition, Quaternion.identity); count++; _teleportedObjectIds.Add(((Object)val2).GetInstanceID()); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("[GameTools] Teleport cart item exception: " + ex.Message)); } } _teleportCurrentIndex++; if (_itemTeleportInterval > 0f && i < allCartItems.Count - 1) { yield return (object)new WaitForSecondsRealtime(_itemTeleportInterval); } } foreach (PhysGrabCart item3 in cartsToTeleport) { try { ItemsInCartRef.Invoke(item3)?.Clear(); ItemsInCartCountRef.Invoke(item3) = 0; } catch { } } } if (objects.Count > 0 && !_cancelTeleportRequested) { _teleportStatusText = (UseChinese() ? "传送普通物品" : "Teleporting Items"); SetGodModeForObjects(objects, enable: true); allProtectedObjects.AddRange(objects); for (i = 0; i < objects.Count; i++) { if (_cancelTeleportRequested) { break; } PhysGrabObject val3 = objects[i]; if ((Object)(object)val3 == (Object)null) { continue; } Vector3 val4 = getTargetPosFunc?.Invoke(val3, i) ?? Vector3.zero; if (val4 != Vector3.zero) { try { val3.Teleport(val4, Quaternion.identity); count++; _teleportedObjectIds.Add(((Object)val3).GetInstanceID()); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("[GameTools] Teleport exception: " + ex2.Message)); } } _teleportCurrentIndex++; if (_itemTeleportInterval > 0f && i < objects.Count - 1) { yield return (object)new WaitForSecondsRealtime(_itemTeleportInterval); } } } if (cartPhysObjs.Count > 0 && !_cancelTeleportRequested) { _teleportStatusText = (UseChinese() ? "传送载具推车" : "Teleporting Carts"); SetGodModeForObjects(cartPhysObjs, enable: true); allProtectedObjects.AddRange(cartPhysObjs); for (i = 0; i < cartPhysObjs.Count; i++) { if (_cancelTeleportRequested) { break; } PhysGrabObject val5 = cartPhysObjs[i]; if ((Object)(object)val5 == (Object)null) { continue; } Vector3 val6 = getTargetPosFunc?.Invoke(val5, i) ?? Vector3.zero; if (val6 != Vector3.zero) { try { val5.Teleport(val6, Quaternion.identity); count++; _teleportedObjectIds.Add(((Object)val5).GetInstanceID()); } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogError((object)("[GameTools] Teleport cart exception: " + ex3.Message)); } } _teleportCurrentIndex++; if (_itemTeleportInterval > 0f && i < cartPhysObjs.Count - 1) { yield return (object)new WaitForSecondsRealtime(_itemTeleportInterval); } } } if (_cancelTeleportRequested) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[GameTools] Teleportation cancelled. {count} objects were teleported."); yield break; } ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[GameTools] Batch teleport completed for {count} objects."); i = 10; while (i > 0 && !_cancelTeleportRequested) { _teleportStatusText = (UseChinese() ? $"落地稳定保护中 ({i}秒)" : $"Securing physics ({i}s)"); _teleportCurrentIndex = _teleportTotalCount; yield return (object)new WaitForSecondsRealtime(1f); i--; } } finally { Plugin plugin = this; try { List list2 = new List(); foreach (PhysGrabObject item4 in allProtectedObjects) { if ((Object)(object)item4 == (Object)null) { continue; } ValuableObject num = ((Component)item4).GetComponent(); if ((Object)(object)num != (Object)null) { if (IsBead(num)) { if (!IsValuableGodModeBeadEnabled()) { list2.Add(item4); } } else if (!IsValuableGodModeValuableEnabled()) { list2.Add(item4); } } else if ((Object)(object)((Component)item4).GetComponent() != (Object)null) { if (!IsValuableGodModeWeaponEnabled()) { list2.Add(item4); } } else if ((Object)(object)((Component)item4).GetComponent() != (Object)null || (Object)(object)((Component)item4).GetComponent() != (Object)null) { if (!IsValuableGodModeVehicleEnabled()) { list2.Add(item4); } } else if ((Object)(object)((Component)item4).GetComponent() != (Object)null) { if (!IsValuableGodModeCosmeticEnabled()) { list2.Add(item4); } } else { list2.Add(item4); } } if (list2.Count > 0) { SetGodModeForObjects(list2, enable: false); } } catch (Exception ex4) { ((BaseUnityPlugin)plugin).Logger.LogError((object)("[GameTools] Error removing god mode in finally: " + ex4.Message)); } plugin._teleportTotalCount = 0; plugin._teleportCurrentIndex = 0; plugin._teleportStatusText = ""; plugin._cancelTeleportRequested = false; plugin.EndTeleportJob(); } } public static bool IsFlipEnabled() { if (IsCosmeticsEnabled() && _cfgFlipEnabled != null) { return _cfgFlipEnabled.Value; } return false; } public static bool IsFlipShowToSelf() { if (IsFlipEnabled() && _cfgFlipShowToSelf != null) { return _cfgFlipShowToSelf.Value; } return false; } public static bool IsSpinEnabled() { if (IsCosmeticsEnabled() && _cfgSpinEnabled != null) { return _cfgSpinEnabled.Value; } return false; } public static float GetSpinSpeed() { return Mathf.Clamp((_cfgSpinSpeed != null) ? _cfgSpinSpeed.Value : 0.3f, 0.1f, 3f); } public static float GetSpinRadius() { return Mathf.Clamp((_cfgSpinRadius != null) ? _cfgSpinRadius.Value : 0f, 0f, 5f); } public static bool IsSpinShowToSelf() { if (IsSpinEnabled() && _cfgSpinShowToSelf != null) { return _cfgSpinShowToSelf.Value; } return false; } public static bool IsSpinFreeze() { if (IsSpinEnabled() && _cfgSpinFreeze != null) { return _cfgSpinFreeze.Value; } return false; } public static Color GetFlashlightColorValue(int colorIndex) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0063: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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) return (Color)(colorIndex switch { 1 => Color.red, 2 => Color.green, 3 => Color.blue, 4 => new Color(1f, 0.08f, 0.58f), 5 => new Color(1f, 0.84f, 0f), 6 => Color.cyan, 7 => new Color(1f, 0.38f, 0f), 8 => Color.HSVToRGB((float)((PhotonNetwork.InRoom ? PhotonNetwork.Time : ((double)Time.time)) * 0.15 % 1.0), 1f, 1f), _ => Color.white, }); } public static float SafeConvertToFloat(object value, float defaultValue) { if (value == null) { return defaultValue; } if (value is float) { return (float)value; } if (value is double) { return (float)(double)value; } if (value is int) { return (int)value; } if (float.TryParse(value.ToString(), out var result)) { return result; } return defaultValue; } public static void UpdateLocalEyeTimer() { if (_cfgEyeEffectEnabled == null || !_cfgEyeEffectEnabled.Value) { CurrentEyeColor = 0; SyncEyeColorToNetwork(0); return; } List list = new List(); if (_cfgEyeMultiSelectRed != null && _cfgEyeMultiSelectRed.Value) { list.Add(2); } if (_cfgEyeMultiSelectGreen != null && _cfgEyeMultiSelectGreen.Value) { list.Add(3); } if (_cfgEyeMultiSelectLove != null && _cfgEyeMultiSelectLove.Value) { list.Add(5); } if (_cfgEyeMultiSelectOrange != null && _cfgEyeMultiSelectOrange.Value) { list.Add(6); } if (_cfgEyeMultiSelectInverted != null && _cfgEyeMultiSelectInverted.Value) { list.Add(7); } if (list.Count == 0) { CurrentEyeColor = 0; SyncEyeColorToNetwork(0); return; } if (list.Count == 1) { CurrentEyeColor = list[0]; SyncEyeColorToNetwork(list[0]); return; } _eyeSwapTimer -= Time.deltaTime; if (_eyeSwapTimer <= 0f) { _eyeSwapTimer = ((_cfgEyeSwapInterval != null) ? _cfgEyeSwapInterval.Value : 0.5f); List list2 = list.FindAll((int c) => c != CurrentEyeColor); if (list2.Count > 0) { CurrentEyeColor = list2[Random.Range(0, list2.Count)]; } else { CurrentEyeColor = list[0]; } SyncEyeColorToNetwork(CurrentEyeColor); } } private static void SyncEyeColorToNetwork(int targetColor) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { int num = 0; if (((Dictionary)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"GT_EyeEffect", out object value)) { num = SafeConvertToInt(value); } if (num != targetColor) { Hashtable val = new Hashtable(); val[(object)"GT_EyeEffect"] = targetColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } } private static void SetGodModeForObjects(List objects, bool enable) { foreach (PhysGrabObject @object in objects) { if (!((Object)(object)@object == (Object)null)) { PhysGrabObjectImpactDetector component = ((Component)@object).GetComponent(); if ((Object)(object)component != (Object)null) { DetectorIsIndestructibleRef.Invoke(component) = enable; } } } } public static List GetSelectedTeleportObjects() { List list = new List(); if ((Object)(object)Instance == (Object)null) { return list; } if (Instance._itemTeleportValuable) { list.AddRange(GetObjectsByType("valuable")); } if (Instance._itemTeleportBead) { list.AddRange(GetObjectsByType("bead")); } if (Instance._itemTeleportWeapon) { list.AddRange(GetObjectsByType("weapon")); } if (Instance._itemTeleportVehicle) { list.AddRange(GetObjectsByType("vehicle")); } if (Instance._itemTeleportCosmetic) { list.AddRange(GetObjectsByType("cosmetic")); } if (Instance._itemTeleportPotion) { list.AddRange(GetObjectsByType("potion")); } if (Instance._itemTeleportHealPack) { list.AddRange(GetObjectsByType("healpack")); } if (Instance._itemTeleportBattery) { list.AddRange(GetObjectsByType("battery")); } if (Instance._itemTeleportMoneyBag) { list.AddRange(GetObjectsByType("moneybag")); } for (int num = list.Count - 1; num >= 0; num--) { PhysGrabObject val = list[num]; if ((Object)(object)val == (Object)null || val.grabbed || val.grabbedLocal) { list.RemoveAt(num); } } if (list.Count > 0) { List list2 = new List(); foreach (PhysGrabObject item in list) { if ((Object)(object)item != (Object)null && !_teleportedObjectIds.Contains(((Object)item).GetInstanceID())) { list2.Add(item); } } if (list2.Count > 0) { return list2; } _teleportedObjectIds.Clear(); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)"[GameTools] All matched items have been teleported. Resetting history for a new round."); } return list; } public static GameObject FindNearestCartOrVehicle() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerController.instance == (Object)null) { return null; } Vector3 position = ((Component)PlayerController.instance).transform.position; GameObject result = null; float num = float.MaxValue; PhysGrabCart[] array = Object.FindObjectsOfType(); foreach (PhysGrabCart val in array) { if (!((Object)(object)val == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)val).transform.position); if (num2 < num) { num = num2; result = ((Component)val).gameObject; } } } ItemVehicle[] array2 = Object.FindObjectsOfType(); foreach (ItemVehicle val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { float num3 = Vector3.Distance(position, ((Component)val2).transform.position); if (num3 < num) { num = num3; result = ((Component)val2).gameObject; } } } return result; } public static void TeleportSelectedObjectsToCart() { if ((Object)(object)PlayerController.instance == (Object)null || (Object)(object)Instance == (Object)null || Instance._isTeleporting) { return; } GameObject targetCart = FindNearestCartOrVehicle(); if ((Object)(object)targetCart == (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)"[GameTools] No cart or vehicle found in scene."); return; } List selectedTeleportObjects = GetSelectedTeleportObjects(); for (int num = selectedTeleportObjects.Count - 1; num >= 0; num--) { if ((Object)(object)selectedTeleportObjects[num] != (Object)null && (Object)(object)((Component)selectedTeleportObjects[num]).gameObject == (Object)(object)targetCart) { selectedTeleportObjects.RemoveAt(num); } } if (selectedTeleportObjects.Count == 0) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"[GameTools] Teleport failed: No matching objects found. Please check your category checkboxes."); } } else { ((MonoBehaviour)Instance).StartCoroutine(Instance.TeleportObjectsWithTemporaryGodModeCoroutine(selectedTeleportObjects, (PhysGrabObject physObj, int index) => ((Object)(object)targetCart == (Object)null) ? Vector3.zero : (targetCart.transform.position + Vector3.up * 0.6f))); } } public static void TeleportSelectedObjectsToFront() { if ((Object)(object)PlayerController.instance == (Object)null || (Object)(object)Instance == (Object)null || Instance._isTeleporting) { return; } List selectedTeleportObjects = GetSelectedTeleportObjects(); if (selectedTeleportObjects.Count == 0) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"[GameTools] Teleport failed: No matching objects found. Please check your category checkboxes."); } return; } ((MonoBehaviour)Instance).StartCoroutine(Instance.TeleportObjectsWithTemporaryGodModeCoroutine(selectedTeleportObjects, delegate { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerController.instance == (Object)null) { return Vector3.zero; } Vector3 position = ((Component)PlayerController.instance).transform.position; Vector3 forward = ((Component)PlayerController.instance).transform.forward; return position + forward * 2f + Vector3.up * 0.5f; })); } public static void TeleportSelectedObjectsToRandom() { if ((Object)(object)Instance == (Object)null || Instance._isTeleporting) { return; } List selectedTeleportObjects = GetSelectedTeleportObjects(); if (selectedTeleportObjects.Count == 0) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"[GameTools] Teleport failed: No matching objects found. Please check your category checkboxes."); } } else { ((MonoBehaviour)Instance).StartCoroutine(Instance.TeleportObjectsWithTemporaryGodModeCoroutine(selectedTeleportObjects, delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) List scatterPoints = GetScatterPoints(); return (scatterPoints == null || scatterPoints.Count == 0) ? Vector3.zero : GetSafeFloorPosition(scatterPoints[Random.Range(0, scatterPoints.Count)]); })); } } public static void TeleportSelectedObjectsToExtractionPoint() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Invalid comparison between Unknown and I4 if ((Object)(object)PlayerController.instance == (Object)null || (Object)(object)Instance == (Object)null || Instance._isTeleporting) { return; } ExtractionPoint[] array = Object.FindObjectsOfType(); List activePoints = new List(); ExtractionPoint[] array2 = array; foreach (ExtractionPoint val in array2) { if ((Object)(object)val == (Object)null) { continue; } try { State val2 = ExtractionPointCurrentStateRef.Invoke(val); if (!ExtractionPointIsShopRef.Invoke(val) && ((int)val2 == 2 || (int)val2 == 6 || (int)val2 == 4)) { activePoints.Add(val); } } catch { } } if (activePoints.Count == 0) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)"[GameTools] No active extraction points found."); return; } List selectedTeleportObjects = GetSelectedTeleportObjects(); if (selectedTeleportObjects.Count == 0) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"[GameTools] Teleport failed: No matching objects found. Please check your category checkboxes."); } } else { ((MonoBehaviour)Instance).StartCoroutine(Instance.TeleportObjectsWithTemporaryGodModeCoroutine(selectedTeleportObjects, (PhysGrabObject physObj, int index) => (activePoints.Count == 0) ? Vector3.zero : GetExtractionPointInteractionPosition(activePoints[Random.Range(0, activePoints.Count)]))); } } public static Vector3 GetClosestRoomCenter(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 result = pos; float num = float.MaxValue; try { RoomVolume[] array = Object.FindObjectsOfType(); if (array != null && array.Length != 0) { RoomVolume[] array2 = array; foreach (RoomVolume val in array2) { if ((Object)(object)val != (Object)null) { float num2 = Vector3.Distance(pos, ((Component)val).transform.position); if (num2 < num) { num = num2; result = ((Component)val).transform.position; } } } } } catch { } return result; } public static Vector3 GetSafeFloorPosition(Vector3 targetPos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return targetPos; } public static Vector3 GetTruckPosition() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)TruckSafetySpawnPoint.instance != (Object)null) { return ((Component)TruckSafetySpawnPoint.instance).transform.position; } if ((Object)(object)LevelGenerator.Instance != (Object)null && (Object)(object)LevelGenerator.Instance.LevelPathTruck != (Object)null) { return ((Component)LevelGenerator.Instance.LevelPathTruck).transform.position; } return Vector3.zero; } public static Vector3 GetRevivePosition(PlayerAvatar avatar) { //IL_0009: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null) { return Vector3.zero; } if (IsReviveAutoToTruck()) { Vector3 truckPosition = GetTruckPosition(); if (truckPosition != Vector3.zero) { return truckPosition; } } return Vector3.zero; } public static void HandleReviveAndTeleport(PlayerAvatar avatar) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null) { return; } Vector3 revivePosition = GetRevivePosition(avatar); try { Instance.RevivePlayer(avatar); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[HandleReviveAndTeleport Revive Error]: {arg}"); } } if (revivePosition != Vector3.zero) { ((MonoBehaviour)Instance).StartCoroutine(DelayTeleportCoroutine(avatar, revivePosition)); } } private static IEnumerator DelayTeleportCoroutine(PlayerAvatar avatar, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float timeout = 5f; float timer = 0f; while ((Object)(object)avatar != (Object)null && PlayerAvatarDeadSetRef.Invoke(avatar) && timer < timeout) { yield return (object)new WaitForSecondsRealtime(1f); timer += 1f; } if (!((Object)(object)avatar != (Object)null) || PlayerAvatarDeadSetRef.Invoke(avatar)) { yield break; } try { TeleportPlayer(avatar, position); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)$"[GameTools] Auto Revive Teleport successful for {((Object)avatar).name} to {position}"); } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[DelayTeleportCoroutine Error] {((Object)avatar).name}: {arg}"); } } } public static void SyncSpinConfigsToNetwork() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown try { if (!PhotonNetwork.InRoom) { return; } if (PhotonNetwork.LocalPlayer != null) { Hashtable val = new Hashtable(); val[(object)"GT_SpinEnabled"] = IsSpinEnabled(); val[(object)"GT_SpinAxis"] = ((_cfgSpinAxis == null) ? 1 : _cfgSpinAxis.Value); val[(object)"GT_SpinSpeed"] = GetSpinSpeed(); val[(object)"GT_SpinDirection"] = ((_cfgSpinDirection == null) ? 1 : _cfgSpinDirection.Value); val[(object)"GT_SpinFreeze"] = IsSpinFreeze(); val[(object)"GT_FlipEnabled"] = IsFlipEnabled(); val[(object)"GT_FrozenTime"] = GameToolsVisuals.GetFrozenTime(); val[(object)"GT_SpinRadius"] = GetSpinRadius(); PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } if ((Object)(object)PlayerAvatar.instance != (Object)null) { string text = PlayerAvatarSteamIDRef.Invoke(PlayerAvatar.instance); if (!string.IsNullOrEmpty(text) && PhotonNetwork.CurrentRoom != null) { Hashtable val2 = new Hashtable(); val2[(object)("GT_SpinEnabled_" + text)] = IsSpinEnabled(); val2[(object)("GT_SpinAxis_" + text)] = ((_cfgSpinAxis == null) ? 1 : _cfgSpinAxis.Value); val2[(object)("GT_SpinSpeed_" + text)] = GetSpinSpeed(); val2[(object)("GT_SpinDirection_" + text)] = ((_cfgSpinDirection == null) ? 1 : _cfgSpinDirection.Value); val2[(object)("GT_SpinFreeze_" + text)] = IsSpinFreeze(); val2[(object)("GT_FlipEnabled_" + text)] = IsFlipEnabled(); val2[(object)("GT_FrozenTime_" + text)] = GameToolsVisuals.GetFrozenTime(); val2[(object)("GT_SpinRadius_" + text)] = GetSpinRadius(); PhotonNetwork.CurrentRoom.SetCustomProperties(val2, (Hashtable)null, (WebFlags)null); } } PhotonNetwork.SendAllOutgoingCommands(); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[SyncSpinConfigsToNetwork Error]: {arg}"); } } } internal static string KeybindNameToBindingPath(string name) { if (string.IsNullOrEmpty(name)) { return "/f4"; } if (name.Length == 1 && name[0] >= '0' && name[0] <= '9') { return "/" + name; } if (name.Length == 1 && char.IsLetter(name[0])) { return "/" + name.ToLowerInvariant(); } if (name.Length > 1 && name[0] == 'F' && int.TryParse(name.Substring(1), out var _)) { return "/" + name; } return name switch { "Space" => "/space", "Enter" => "/enter", "Tab" => "/tab", "LeftShift" => "/leftShift", "RightShift" => "/rightShift", "LeftControl" => "/leftCtrl", "RightControl" => "/rightCtrl", _ => "/" + char.ToLower(name[0]) + name.Substring(1), }; } internal static void RebindOpenKey() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Instance == (Object)null) && Instance._openKey != null && !((Object)(object)InputManager.instance == (Object)null)) { string value = Instance._openKey.Value; if (!(_lastAppliedOpenKey == value)) { _lastAppliedOpenKey = value; InputManager.instance.Rebind(OpenInputKey, KeybindNameToBindingPath(value)); } } } internal static void InputManagerInitializeInputsPostfix() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) Dictionary value = Traverse.Create((object)InputManager.instance).Field>("inputActions").Value; if (value != null && !value.ContainsKey(OpenInputKey)) { InputAction val = new InputAction("OpenGameTools", (InputActionType)0, KeybindNameToBindingPath(Instance?._openKey.Value ?? "F4"), (string)null, (string)null, (string)null); value.Add(OpenInputKey, val); val.Enable(); _lastAppliedOpenKey = Instance?._openKey.Value ?? "F4"; } } internal static void PlayerControllerStartPostfix() { RebindOpenKey(); } private static KeyControl GetKeyControl(Keyboard keyboard, string keyName) { //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown if (keyboard == null || string.IsNullOrEmpty(keyName)) { return null; } if (string.Equals(keyName, "F1", StringComparison.OrdinalIgnoreCase)) { return keyboard.f1Key; } if (string.Equals(keyName, "F2", StringComparison.OrdinalIgnoreCase)) { return keyboard.f2Key; } if (string.Equals(keyName, "F3", StringComparison.OrdinalIgnoreCase)) { return keyboard.f3Key; } if (string.Equals(keyName, "F4", StringComparison.OrdinalIgnoreCase)) { return keyboard.f4Key; } if (string.Equals(keyName, "F5", StringComparison.OrdinalIgnoreCase)) { return keyboard.f5Key; } if (string.Equals(keyName, "F6", StringComparison.OrdinalIgnoreCase)) { return keyboard.f6Key; } if (string.Equals(keyName, "F7", StringComparison.OrdinalIgnoreCase)) { return keyboard.f7Key; } if (string.Equals(keyName, "F8", StringComparison.OrdinalIgnoreCase)) { return keyboard.f8Key; } if (string.Equals(keyName, "F9", StringComparison.OrdinalIgnoreCase)) { return keyboard.f9Key; } if (string.Equals(keyName, "F10", StringComparison.OrdinalIgnoreCase)) { return keyboard.f10Key; } if (string.Equals(keyName, "F11", StringComparison.OrdinalIgnoreCase)) { return keyboard.f11Key; } if (string.Equals(keyName, "F12", StringComparison.OrdinalIgnoreCase)) { return keyboard.f12Key; } if (string.Equals(keyName, "Space", StringComparison.OrdinalIgnoreCase)) { return keyboard.spaceKey; } if (string.Equals(keyName, "Enter", StringComparison.OrdinalIgnoreCase)) { return keyboard.enterKey; } if (string.Equals(keyName, "Tab", StringComparison.OrdinalIgnoreCase)) { return keyboard.tabKey; } if (string.Equals(keyName, "LeftShift", StringComparison.OrdinalIgnoreCase)) { return keyboard.leftShiftKey; } if (string.Equals(keyName, "RightShift", StringComparison.OrdinalIgnoreCase)) { return keyboard.rightShiftKey; } if (string.Equals(keyName, "LeftControl", StringComparison.OrdinalIgnoreCase)) { return keyboard.leftCtrlKey; } if (string.Equals(keyName, "RightControl", StringComparison.OrdinalIgnoreCase)) { return keyboard.rightCtrlKey; } if (keyName.Length == 1) { char c = char.ToLowerInvariant(keyName[0]); if (c >= 'a' && c <= 'z') { PropertyInfo property = ((object)keyboard).GetType().GetProperty(c + "Key"); if (property != null) { return (KeyControl)property.GetValue(keyboard); } } else if (c >= '0' && c <= '9') { PropertyInfo propertyInfo = ((object)keyboard).GetType().GetProperty("digit" + c + "Key") ?? ((object)keyboard).GetType().GetProperty("numpad" + c + "Key"); if (propertyInfo != null) { return (KeyControl)propertyInfo.GetValue(keyboard); } } } return null; } private bool IsOpenKeyPressed() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) try { string text = _openKey?.Value ?? "F4"; Keyboard current = Keyboard.current; if (current != null) { if (_cachedOpenKeyControlName != text || _cachedOpenKeyControl == null) { _cachedOpenKeyControl = GetKeyControl(current, text); _cachedOpenKeyControlName = text; } if (_cachedOpenKeyControl != null && ((ButtonControl)_cachedOpenKeyControl).wasPressedThisFrame) { return true; } } } catch { } try { if ((Object)(object)InputManager.instance != (Object)null && SemiFunc.InputDown(OpenInputKey)) { return true; } } catch { } return false; } private void InitStyles() { //IL_0025: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_0147: 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_0157: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_0198: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Expected O, but got Unknown //IL_0200: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_0261: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029f: 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_02ae: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Expected O, but got Unknown //IL_02c2: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Expected O, but got Unknown //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Expected O, but got Unknown //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Expected O, but got Unknown //IL_03c4: Expected O, but got Unknown //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Expected O, but got Unknown //IL_044d: Expected O, but got Unknown //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Expected O, but got Unknown //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Expected O, but got Unknown //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Expected O, but got Unknown //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Expected O, but got Unknown //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Expected O, but got Unknown //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Expected O, but got Unknown //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Expected O, but got Unknown //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Expected O, but got Unknown //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Expected O, but got Unknown //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Expected O, but got Unknown //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Expected O, but got Unknown //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Expected O, but got Unknown if (!_stylesInit) { _stylesInit = true; _texDark = MakeTex(new Color(0.12f, 0.12f, 0.14f, 0.97f)); _texMid = MakeTex(new Color(0.18f, 0.18f, 0.22f, 0.95f)); _texLight = MakeTex(new Color(0.25f, 0.25f, 0.3f, 0.9f)); _texGreen = MakeTex(new Color(0.2f, 0.55f, 0.2f)); _texRed = MakeTex(new Color(0.6f, 0.2f, 0.2f)); _texSection = MakeTex(new Color(0.15f, 0.15f, 0.18f, 0.95f)); _texBorder = MakeTex(new Color(0.3f, 0.3f, 0.35f, 0.8f)); _texMask = MakeTex(new Color(0f, 0f, 0f, 0.65f)); GUIStyle val = new GUIStyle(GUI.skin.window); val.normal.background = _texDark; val.normal.textColor = Color.white; val.onNormal.background = _texDark; val.onNormal.textColor = Color.white; val.fontSize = 22; val.padding = new RectOffset(16, 16, 36, 16); _sWindow = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 21, fontStyle = (FontStyle)1 }; val2.normal.textColor = new Color(0.95f, 0.85f, 0.6f); val2.alignment = (TextAnchor)3; val2.padding = new RectOffset(0, 0, 0, 0); val2.margin = new RectOffset(0, 0, 0, 0); _sTitle = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 18 }; val3.normal.textColor = new Color(0.92f, 0.92f, 0.95f); val3.alignment = (TextAnchor)3; val3.padding = new RectOffset(0, 0, 0, 0); val3.margin = new RectOffset(0, 0, 0, 0); _sLabel = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 15 }; val4.normal.textColor = new Color(0.7f, 0.9f, 0.7f); val4.alignment = (TextAnchor)3; val4.padding = new RectOffset(0, 0, 0, 0); val4.margin = new RectOffset(0, 0, 0, 0); _sStatus = val4; _sBtnGreen = MakeBtn(_texGreen, new Color(0.25f, 0.65f, 0.25f)); _sBtnRed = MakeBtn(_texRed, new Color(0.7f, 0.25f, 0.25f)); _sBtnNormal = MakeBtn(_texLight, new Color(0.32f, 0.32f, 0.4f)); _sBtnClose = new GUIStyle(_sBtnRed); _sBtnClose.fontSize = 20; _sBtnClose.fontStyle = (FontStyle)1; _sBtnClose.alignment = (TextAnchor)4; _sBtnClose.padding = new RectOffset(0, 0, 0, 0); GUIStyle val5 = new GUIStyle(GUI.skin.box); val5.normal.background = _texSection; val5.normal.textColor = Color.white; val5.padding = new RectOffset(10, 10, 10, 10); _sSection = val5; GUIStyle val6 = new GUIStyle(_sLabel); val6.normal.textColor = new Color(0.4f, 0.85f, 0.4f); _sToggleOn = val6; GUIStyle val7 = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val7.normal.textColor = Color.white; val7.padding = new RectOffset(0, 0, 0, 0); val7.margin = new RectOffset(0, 0, 0, 0); _sCheckmarkStyleWhite = val7; GUIStyle val8 = new GUIStyle(GUI.skin.horizontalSlider) { fixedHeight = 8f }; val8.normal.background = _texSection; _sSlider = val8; GUIStyle val9 = new GUIStyle(GUI.skin.horizontalSliderThumb) { fixedWidth = 18f, fixedHeight = 18f }; val9.normal.background = _texGreen; _sThumb = val9; _sThumb.hover.background = MakeTex(new Color(0.25f, 0.65f, 0.25f)); _sThumb.active.background = MakeTex(Color.yellow); GUIStyle val10 = new GUIStyle(GUI.skin.textField) { fontSize = 18 }; val10.normal.background = _texSection; val10.normal.textColor = Color.white; val10.focused.background = _texLight; val10.focused.textColor = Color.white; _sTextInput = val10; _sCenteredLabel = new GUIStyle(_sLabel) { alignment = (TextAnchor)4, richText = true }; GUIStyle val11 = new GUIStyle(_sLabel) { fontSize = 12, alignment = (TextAnchor)5 }; val11.normal.textColor = new Color(1f, 0.6f, 0f, 0.9f); _sWarningStyle = val11; _sLabelLarge = new GUIStyle(_sLabel) { fontSize = 21 }; _sHeaderStyle = new GUIStyle(_sLabelLarge) { fontStyle = (FontStyle)1 }; _sInputStyleLarge = new GUIStyle(_sTextInput) { fontSize = 20 }; _sToggleStyleLarge = new GUIStyle(GUI.skin.toggle) { fontSize = 20 }; _sQuickBtnStyle = new GUIStyle(_sBtnNormal) { fontSize = 15, padding = new RectOffset(0, 0, 0, 0), alignment = (TextAnchor)4 }; GUIStyle val12 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 13, fontStyle = (FontStyle)1 }; val12.normal.textColor = Color.gray; _sLabelEpComplete = val12; GUIStyle val13 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 13, fontStyle = (FontStyle)1 }; val13.normal.textColor = Color.red; _sLabelEpLocked = val13; GUIStyle val14 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 13, fontStyle = (FontStyle)1 }; val14.normal.textColor = Color.green; _sLabelEpUnlocked = val14; _sMsgStyle = new GUIStyle(_sLabel) { richText = true, alignment = (TextAnchor)1 }; } } private static GUIStyle MakeBtn(Texture2D bg, Color hover) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_006f: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008b: Expected O, but got Unknown Texture2D background = MakeTex(hover); GUIStyle val = new GUIStyle(GUI.skin.button) { fontSize = 18, fontStyle = (FontStyle)1 }; val.normal.background = bg; val.normal.textColor = Color.white; val.hover.background = background; val.hover.textColor = Color.white; val.active.background = background; val.active.textColor = Color.yellow; val.padding = new RectOffset(12, 12, 6, 6); return val; } private static Texture2D MakeTex(Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); val.SetPixels((Color[])(object)new Color[4] { c, c, c, c }); val.Apply(); ((Object)val).hideFlags = (HideFlags)61; return val; } private void DrawCloseButton() { //IL_0034: 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_004f: Expected O, but got Unknown string text = (UseChinese() ? "关闭" : "Close"); if (GUI.Button(new Rect(((Rect)(ref _windowRect)).width - 46f, 4f, 42f, 34f), new GUIContent("✕", text), _sBtnClose)) { SetWindowOpen(open: false); } } private void DrawBorderRect(Rect rect, Texture2D tex) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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) GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 1f), (Texture)(object)tex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + ((Rect)(ref rect)).height - 1f, ((Rect)(ref rect)).width, 1f), (Texture)(object)tex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)tex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - 1f, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)tex); } private bool DrawStyledToggle(Rect rect, bool value, string text) { //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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) float num = 22f; float num2 = ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - num) * 0.5f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x, num2, num, num); Rect val2 = new Rect(((Rect)(ref rect)).x + num + 8f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - num - 8f, ((Rect)(ref rect)).height); if (GUI.Button(rect, GUIContent.none, GUIStyle.none)) { value = !value; } if (value) { GUI.DrawTexture(val, (Texture)(object)_texGreen); GUI.Label(val, "✓", _sCheckmarkStyleWhite); } else { GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); } GUI.Label(val2, text, value ? _sToggleOn : _sLabel); return value; } private int DrawStyledSlider(Rect rect, int value, int min, int max, string label) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 280f, ((Rect)(ref rect)).height), label, _sLabel); int num = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(((Rect)(ref rect)).x + 290f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 390f, 20f), (float)value, (float)min, (float)max, _sSlider, _sThumb)); string text = (UseChinese() ? $"Class {num + 1}" : $"Class {num + 1}"); GUI.Label(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - 90f, ((Rect)(ref rect)).y, 80f, ((Rect)(ref rect)).height), text, _sToggleOn); return num; } private float DrawStyledSliderFloat(Rect rect, float value, float min, float max, string label) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 280f, ((Rect)(ref rect)).height), label, _sLabel); float num = GUI.HorizontalSlider(new Rect(((Rect)(ref rect)).x + 290f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 390f, 20f), value, min, max, _sSlider, _sThumb); num = Mathf.Round(num * 10f) / 10f; string text = $"{num:F1}x"; GUI.Label(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - 90f, ((Rect)(ref rect)).y, 80f, ((Rect)(ref rect)).height), text, _sToggleOn); return num; } private int DrawStyledSliderInt(Rect rect, int value, int min, int max, string label) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 280f, ((Rect)(ref rect)).height), label, _sLabel); int num = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(((Rect)(ref rect)).x + 290f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 390f, 20f), (float)value, (float)min, (float)max, _sSlider, _sThumb)); string text = $"{num}x"; GUI.Label(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - 90f, ((Rect)(ref rect)).y, 80f, ((Rect)(ref rect)).height), text, _sToggleOn); return num; } private void OnGUI() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (_windowOpen) { GUI.enabled = true; InitStyles(); if (!_windowCentered) { ((Rect)(ref _windowRect)).x = ((float)Screen.width - ((Rect)(ref _windowRect)).width) * 0.5f; ((Rect)(ref _windowRect)).y = ((float)Screen.height - ((Rect)(ref _windowRect)).height) * 0.5f; _windowCentered = true; } string text = (UseChinese() ? "游戏工具箱" : "✦ GameTools"); _windowRect = GUI.Window(33002, _windowRect, new WindowFunction(DrawWindow), text, _sWindow); } } private void DrawWindow(int id) { //IL_3aca: Unknown result type (might be due to invalid IL or missing references) //IL_3b21: Unknown result type (might be due to invalid IL or missing references) //IL_3b64: Unknown result type (might be due to invalid IL or missing references) //IL_3a15: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_21cc: Unknown result type (might be due to invalid IL or missing references) //IL_21fd: Unknown result type (might be due to invalid IL or missing references) //IL_2b71: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_2792: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0ad9: Unknown result type (might be due to invalid IL or missing references) //IL_223a: Unknown result type (might be due to invalid IL or missing references) //IL_2864: Unknown result type (might be due to invalid IL or missing references) //IL_2a27: Unknown result type (might be due to invalid IL or missing references) //IL_2a2c: Unknown result type (might be due to invalid IL or missing references) //IL_2a36: Unknown result type (might be due to invalid IL or missing references) //IL_2a3b: Unknown result type (might be due to invalid IL or missing references) //IL_2a40: Unknown result type (might be due to invalid IL or missing references) //IL_2a96: Unknown result type (might be due to invalid IL or missing references) //IL_3b00: Unknown result type (might be due to invalid IL or missing references) //IL_3f70: Unknown result type (might be due to invalid IL or missing references) //IL_3f83: Unknown result type (might be due to invalid IL or missing references) //IL_22e4: Unknown result type (might be due to invalid IL or missing references) //IL_2320: Unknown result type (might be due to invalid IL or missing references) //IL_2816: Unknown result type (might be due to invalid IL or missing references) //IL_2907: Unknown result type (might be due to invalid IL or missing references) //IL_2a44: Unknown result type (might be due to invalid IL or missing references) //IL_4067: Unknown result type (might be due to invalid IL or missing references) //IL_2c32: Unknown result type (might be due to invalid IL or missing references) //IL_3a58: Unknown result type (might be due to invalid IL or missing references) //IL_3a5d: Unknown result type (might be due to invalid IL or missing references) //IL_3a67: Unknown result type (might be due to invalid IL or missing references) //IL_3a6c: Unknown result type (might be due to invalid IL or missing references) //IL_3a71: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_235d: Unknown result type (might be due to invalid IL or missing references) //IL_2cdf: Unknown result type (might be due to invalid IL or missing references) //IL_2d18: Unknown result type (might be due to invalid IL or missing references) //IL_3fd2: Unknown result type (might be due to invalid IL or missing references) //IL_241d: Unknown result type (might be due to invalid IL or missing references) //IL_2459: Unknown result type (might be due to invalid IL or missing references) //IL_293d: Unknown result type (might be due to invalid IL or missing references) //IL_294c: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Unknown result type (might be due to invalid IL or missing references) //IL_299c: Unknown result type (might be due to invalid IL or missing references) //IL_3aa5: Unknown result type (might be due to invalid IL or missing references) //IL_2496: Unknown result type (might be due to invalid IL or missing references) //IL_2bdf: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_2540: Unknown result type (might be due to invalid IL or missing references) //IL_257c: Unknown result type (might be due to invalid IL or missing references) //IL_2d6f: Unknown result type (might be due to invalid IL or missing references) //IL_32de: Unknown result type (might be due to invalid IL or missing references) //IL_32f1: Unknown result type (might be due to invalid IL or missing references) //IL_2de1: Unknown result type (might be due to invalid IL or missing references) //IL_2e1a: Unknown result type (might be due to invalid IL or missing references) //IL_25b9: Unknown result type (might be due to invalid IL or missing references) //IL_2679: Unknown result type (might be due to invalid IL or missing references) //IL_3bca: Unknown result type (might be due to invalid IL or missing references) //IL_3c03: Unknown result type (might be due to invalid IL or missing references) //IL_2e71: Unknown result type (might be due to invalid IL or missing references) //IL_0a68: Unknown result type (might be due to invalid IL or missing references) //IL_26e7: Unknown result type (might be due to invalid IL or missing references) //IL_2ee3: Unknown result type (might be due to invalid IL or missing references) //IL_3c5c: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_3c87: Unknown result type (might be due to invalid IL or missing references) //IL_3c6f: Unknown result type (might be due to invalid IL or missing references) //IL_3cd9: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_2f4e: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_3d0d: Unknown result type (might be due to invalid IL or missing references) //IL_3d64: Unknown result type (might be due to invalid IL or missing references) //IL_3d9e: Unknown result type (might be due to invalid IL or missing references) //IL_346c: Unknown result type (might be due to invalid IL or missing references) //IL_34a5: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_2fd6: Unknown result type (might be due to invalid IL or missing references) //IL_3dd2: Unknown result type (might be due to invalid IL or missing references) //IL_34e1: Unknown result type (might be due to invalid IL or missing references) //IL_3e47: Unknown result type (might be due to invalid IL or missing references) //IL_3e8d: Unknown result type (might be due to invalid IL or missing references) //IL_30ef: Unknown result type (might be due to invalid IL or missing references) //IL_353a: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_3565: Unknown result type (might be due to invalid IL or missing references) //IL_354d: Unknown result type (might be due to invalid IL or missing references) //IL_1820: Unknown result type (might be due to invalid IL or missing references) //IL_1833: Unknown result type (might be due to invalid IL or missing references) //IL_1856: Unknown result type (might be due to invalid IL or missing references) //IL_0c0b: Unknown result type (might be due to invalid IL or missing references) //IL_0c1e: Unknown result type (might be due to invalid IL or missing references) //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_3ed1: Unknown result type (might be due to invalid IL or missing references) //IL_1d41: Unknown result type (might be due to invalid IL or missing references) //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_318e: Unknown result type (might be due to invalid IL or missing references) //IL_31e3: Unknown result type (might be due to invalid IL or missing references) //IL_31f6: Unknown result type (might be due to invalid IL or missing references) //IL_3214: Unknown result type (might be due to invalid IL or missing references) //IL_35d0: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_1d94: Unknown result type (might be due to invalid IL or missing references) //IL_1da7: Unknown result type (might be due to invalid IL or missing references) //IL_1dc9: Unknown result type (might be due to invalid IL or missing references) //IL_0d07: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_3626: Unknown result type (might be due to invalid IL or missing references) //IL_1911: Unknown result type (might be due to invalid IL or missing references) //IL_0d4d: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Unknown result type (might be due to invalid IL or missing references) //IL_0d82: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_365a: Unknown result type (might be due to invalid IL or missing references) //IL_36b1: Unknown result type (might be due to invalid IL or missing references) //IL_36eb: Unknown result type (might be due to invalid IL or missing references) //IL_0dbb: Unknown result type (might be due to invalid IL or missing references) //IL_371f: Unknown result type (might be due to invalid IL or missing references) //IL_1e81: Unknown result type (might be due to invalid IL or missing references) //IL_1e94: Unknown result type (might be due to invalid IL or missing references) //IL_1eb6: Unknown result type (might be due to invalid IL or missing references) //IL_1957: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_3794: Unknown result type (might be due to invalid IL or missing references) //IL_37ce: Unknown result type (might be due to invalid IL or missing references) //IL_1995: Unknown result type (might be due to invalid IL or missing references) //IL_19a8: Unknown result type (might be due to invalid IL or missing references) //IL_19ca: Unknown result type (might be due to invalid IL or missing references) //IL_0df5: Unknown result type (might be due to invalid IL or missing references) //IL_1ef4: Unknown result type (might be due to invalid IL or missing references) //IL_3802: Unknown result type (might be due to invalid IL or missing references) //IL_3859: Unknown result type (might be due to invalid IL or missing references) //IL_3893: Unknown result type (might be due to invalid IL or missing references) //IL_1a05: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_38c7: Unknown result type (might be due to invalid IL or missing references) //IL_391e: Unknown result type (might be due to invalid IL or missing references) //IL_1a3c: Unknown result type (might be due to invalid IL or missing references) //IL_3979: Unknown result type (might be due to invalid IL or missing references) //IL_1f92: Unknown result type (might be due to invalid IL or missing references) //IL_1a73: Unknown result type (might be due to invalid IL or missing references) //IL_1aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_1ff4: Unknown result type (might be due to invalid IL or missing references) //IL_0ec6: Unknown result type (might be due to invalid IL or missing references) //IL_0efb: Unknown result type (might be due to invalid IL or missing references) //IL_2032: Unknown result type (might be due to invalid IL or missing references) //IL_0f64: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0f99: Unknown result type (might be due to invalid IL or missing references) //IL_1aea: Unknown result type (might be due to invalid IL or missing references) //IL_39d2: Unknown result type (might be due to invalid IL or missing references) //IL_39d7: Unknown result type (might be due to invalid IL or missing references) //IL_39db: Unknown result type (might be due to invalid IL or missing references) //IL_0fd2: Unknown result type (might be due to invalid IL or missing references) //IL_2106: Unknown result type (might be due to invalid IL or missing references) //IL_2119: Unknown result type (might be due to invalid IL or missing references) //IL_213b: Unknown result type (might be due to invalid IL or missing references) //IL_1b4c: Unknown result type (might be due to invalid IL or missing references) //IL_1030: Unknown result type (might be due to invalid IL or missing references) //IL_1ba0: Unknown result type (might be due to invalid IL or missing references) //IL_109b: Unknown result type (might be due to invalid IL or missing references) //IL_10ae: Unknown result type (might be due to invalid IL or missing references) //IL_10d0: Unknown result type (might be due to invalid IL or missing references) //IL_1c0b: Unknown result type (might be due to invalid IL or missing references) //IL_1109: Unknown result type (might be due to invalid IL or missing references) //IL_1191: Unknown result type (might be due to invalid IL or missing references) //IL_1c8c: Unknown result type (might be due to invalid IL or missing references) //IL_11ee: Unknown result type (might be due to invalid IL or missing references) //IL_1251: Unknown result type (might be due to invalid IL or missing references) //IL_12b4: Unknown result type (might be due to invalid IL or missing references) //IL_1317: Unknown result type (might be due to invalid IL or missing references) //IL_1387: Unknown result type (might be due to invalid IL or missing references) //IL_139a: Unknown result type (might be due to invalid IL or missing references) //IL_13bc: Unknown result type (might be due to invalid IL or missing references) //IL_13f5: Unknown result type (might be due to invalid IL or missing references) //IL_1453: Unknown result type (might be due to invalid IL or missing references) //IL_14cb: Unknown result type (might be due to invalid IL or missing references) //IL_153e: Unknown result type (might be due to invalid IL or missing references) //IL_15ab: Unknown result type (might be due to invalid IL or missing references) //IL_162b: Unknown result type (might be due to invalid IL or missing references) //IL_163e: Unknown result type (might be due to invalid IL or missing references) //IL_1661: Unknown result type (might be due to invalid IL or missing references) //IL_16bf: Unknown result type (might be due to invalid IL or missing references) //IL_172b: Unknown result type (might be due to invalid IL or missing references) //IL_17a2: Unknown result type (might be due to invalid IL or missing references) int num; if (!_showConfirmSpawn || _pendingSpawnInfo == null) { num = (_showConfirmKillAllTeammates ? 1 : 0); if (num == 0) { goto IL_00ee; } } else { num = 1; } if ((Object)(object)_texMask != (Object)null) { GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, ((Rect)(ref _windowRect)).height), (Texture)(object)_texMask); } float num2 = 460f; float num3 = 220f; float num4 = (((Rect)(ref _windowRect)).width - num2) * 0.5f; float num5 = (((Rect)(ref _windowRect)).height - num3) * 0.5f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num4, num5, num2, num3); if (!((Rect)(ref val)).Contains(Event.current.mousePosition)) { GUI.Button(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, ((Rect)(ref _windowRect)).height), "", GUIStyle.none); } goto IL_00ee; IL_00ee: GUI.enabled = num == 0; float num6 = ((Rect)(ref _windowRect)).width - 32f; float num7 = 36f; DrawCloseButton(); string text = (UseChinese() ? "游戏工具控制中心" : "✦ Game Control Center"); GUI.Label(new Rect(16f, num7, num6 - 300f, 30f), text, _sTitle); bool flag = IsProhibitedByHost(); if (flag) { string text2 = (UseChinese() ? "⚠\ufe0f 房主已禁用大部分功能" : "⚠\ufe0f Host Prohibited"); GUI.Label(new Rect(296f, num7 + 2f, 300f, 26f), "" + text2 + "", _sStatus); } string text3 = (UseChinese() ? "Switch to English" : "切换中文"); if (GUI.Button(new Rect(((Rect)(ref _windowRect)).width - 220f, num7 - 4f, 170f, 36f), text3, _sBtnNormal)) { DisplayLanguage value = (UseChinese() ? DisplayLanguage.English : DisplayLanguage.中文); _cfgLanguage.Value = value; } num7 += 44f; string[] array = ((!UseChinese()) ? new string[8] { "⚙\ufe0f Global", "\ud83d\udc57 Cosmetics", "\ud83d\udc65 Players", "\ud83c\udfae Item Control", "\ud83c\udfad Game Visuals", "\ud83e\uddea Upgrades", "\ud83d\udce6 Spawner", "\ud83d\udc7e Spawns" } : new string[8] { "⚙\ufe0f 全局设置", "\ud83d\udc57 个人装扮", "\ud83d\udc65 玩家控制", "\ud83c\udfae 物品控制", "\ud83c\udfad 局内表现", "\ud83e\uddea 升级控制", "\ud83d\udce6 刷取助手", "\ud83d\udc7e 刷怪监控" }); float num8 = num6 / 8f; bool flag2 = !PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient; if (flag && _currentTab >= 2) { _currentTab = 1; } else if ((_currentTab == 5 || _currentTab == 6) && !flag2) { _currentTab = 0; } for (int i = 0; i < 8; i++) { bool flag3 = _currentTab == i; bool enabled = GUI.enabled; string text4 = array[i]; if (flag && i >= 2) { GUI.enabled = false; text4 = array[i] + (UseChinese() ? "(禁用)" : "(Host)"); } else if (i == 5 && !flag2) { GUI.enabled = false; text4 = (UseChinese() ? "\ud83e\uddea 升级控制(禁用)" : "\ud83e\uddea Upgrades(Host)"); } else if (i == 6 && !flag2) { GUI.enabled = false; text4 = (UseChinese() ? "\ud83d\udce6 刷取助手(禁用)" : "\ud83d\udce6 Spawner(Host)"); } if (GUI.Button(new Rect(16f + (float)i * num8, num7, num8 - 4f, 40f), text4, flag3 ? _sBtnGreen : _sBtnNormal)) { _currentTab = i; } GUI.enabled = enabled; } num7 += 48f; float num9 = ((Rect)(ref _windowRect)).height - num7 - 16f - 10f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(16f, num7, num6, num9); if (_currentTab == 6) { bool enabled2 = GUI.enabled; if (!_cfgModEnabled.Value || !flag2) { GUI.enabled = false; } DrawTabSpawner(val2); GUI.enabled = enabled2; } else { Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(0f, 0f, num6 - 16f, _lastVirtualHeight); _scrollPos = GUI.BeginScrollView(val2, _scrollPos, val3); float curY = 0f; float num10 = num6 - 18f; float num11 = 0f; float num12 = num11 + 12f; float num13 = num10 - 24f; if (_currentTab == 0) { string text5 = (UseChinese() ? "\ud83d\udd04 重置全部全局选项" : "\ud83d\udd04 Reset All Global Settings"); if (GUI.Button(new Rect(num11, curY, num10, 40f), text5, _sBtnRed)) { ResetGlobalSettings(); } curY += 52f; Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(num11, curY, num10, 120f); GUI.Box(val4, "", _sSection); DrawBorderRect(val4, _texBorder); float num14 = curY + 12f; bool flag4 = DrawStyledToggle(new Rect(num12, num14, num13, 34f), _cfgModEnabled.Value, UseChinese() ? "启用整个模组功能" : "Enable GameTools Mod"); if (flag4 != _cfgModEnabled.Value) { _cfgModEnabled.Value = flag4; } float num15 = num14 + 40f; bool enabled3 = GUI.enabled; if (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient) { GUI.enabled = false; } string text6 = (UseChinese() ? "禁止其他玩家使用此模组 (仅房主可用)" : "Prohibit other players from using mod (Host Only)"); if (!PhotonNetwork.InRoom) { text6 = (UseChinese() ? "禁止其他玩家使用此模组" : "Prohibit other players from using mod"); } bool flag5 = DrawStyledToggle(new Rect(num12, num15, num13, 34f), IsProhibitOthersEnabled(), text6); if (flag5 != IsProhibitOthersEnabled()) { SetProhibitOthers(flag5); } GUI.enabled = enabled3; curY += 135f; float num16 = 120f; Rect val5 = default(Rect); ((Rect)(ref val5))..ctor(num11, curY, num10, num16); GUI.Box(val5, "", _sSection); DrawBorderRect(val5, _texBorder); float num17 = curY + 12f; GUI.Label(new Rect(num12, num17, num13, 24f), UseChinese() ? "⌨\ufe0f 快捷键及按键冲突解决" : "⌨\ufe0f Hotkeys & Key Conflict Resolution", _sTitle); num17 += 28f; bool flag6 = DrawStyledToggle(new Rect(num12, num17, num13, 30f), _cfgEnableHKeyHotkey.Value, UseChinese() ? "启用 H 键快捷键切换第三人称视角" : "Enable H Key Hotkey for Third-Person View"); if (flag6 != _cfgEnableHKeyHotkey.Value) { _cfgEnableHKeyHotkey.Value = flag6; SaveRuntimeConfig(); } num17 += 34f; bool flag7 = DrawStyledToggle(new Rect(num12, num17, num13, 30f), _cfgEnableGKeyHotkey.Value, UseChinese() ? "启用 G 键快捷键切换上帝飞行无敌模式" : "Enable G Key Hotkey for God Flight Mode"); if (flag7 != _cfgEnableGKeyHotkey.Value) { _cfgEnableGKeyHotkey.Value = flag7; SaveRuntimeConfig(); } curY += num16 + 16f; bool enabled4 = GUI.enabled; if (!IsStaticModEnabled()) { GUI.enabled = false; } Rect val6 = default(Rect); ((Rect)(ref val6))..ctor(num11, curY, num10, 170f); GUI.Box(val6, "", _sSection); DrawBorderRect(val6, _texBorder); num14 = curY + 12f; GUI.Label(new Rect(num12, num14, num13, 24f), UseChinese() ? "模组运行状态信息:" : "Mod Runtime Information:", _sTitle); num14 += 30f; string text7 = ((!SemiFunc.RunIsLobbyMenu()) ? (UseChinese() ? "已进入游戏关卡内" : "In Level / Game Session") : (UseChinese() ? "当前在大厅菜单中" : "In Lobby Menu")); GUI.Label(new Rect(num12, num14, num13, 24f), (UseChinese() ? "环境状态: " : "Environment: ") + text7, _sLabel); num14 += 26f; string text8; try { text8 = ((!PhotonNetwork.InRoom) ? (UseChinese() ? "单机模式 (可用)" : "Singleplayer (Available)") : ((!PhotonNetwork.IsMasterClient) ? (UseChinese() ? "联机客机 (功能可用,控制他人需房主)" : "Client (Available, control requires Host)") : (UseChinese() ? "联机房主 / 主机 (可用)" : "Host / MasterClient (Available)"))); } catch { text8 = (UseChinese() ? "单机模式 (可用)" : "Singleplayer (Available)"); } GUI.Label(new Rect(num12, num14, num13, 24f), (UseChinese() ? "权限状态: " : "Authority: ") + text8, _sStatus); num14 += 26f; string text9 = (((Object)(object)PlayerController.instance != (Object)null) ? PlayerSteamIDRef.Invoke(PlayerController.instance) : null); string text10 = (string.IsNullOrEmpty(text9) ? (UseChinese() ? "等待玩家初始化..." : "Waiting for Player avatar...") : (UseChinese() ? ("本地玩家ID已就绪 (SteamID: " + text9 + ")") : ("Player Ready (SteamID: " + text9 + ")"))); GUI.Label(new Rect(num12, num14, num13, 24f), (UseChinese() ? "玩家状态: " : "Player State: ") + text10, _sStatus); GUI.enabled = enabled4; curY += 185f; Rect val7 = default(Rect); ((Rect)(ref val7))..ctor(num11, curY, num10, 105f); GUI.Box(val7, "", _sSection); DrawBorderRect(val7, _texBorder); float num18 = curY + 12f; GUI.Label(new Rect(num12, num18, num13, 24f), UseChinese() ? "\ud83c\udfae 关卡与回合控制" : "\ud83c\udfae Level & Round Control", _sTitle); num18 += 30f; bool enabled5 = GUI.enabled; if (!IsStaticModEnabled() || (Object)(object)RunManager.instance == (Object)null) { GUI.enabled = false; } float num19 = (num13 - 12f) / 2f; string text11 = (UseChinese() ? "⚡ 切换下一关" : "⚡ Next Level"); if (GUI.Button(new Rect(num12, num18, num19, 40f), text11, _sBtnGreen)) { try { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[ChangeLevel Error]: {arg}"); } } } string text12 = (UseChinese() ? "\ud83d\udd04 重载当前关卡" : "\ud83d\udd04 Reload Level"); if (GUI.Button(new Rect(num12 + num19 + 12f, num18, num19, 40f), text12, _sBtnRed)) { try { RunManager.instance.RestartScene(); } catch (Exception arg2) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[RestartScene Error]: {arg2}"); } } } GUI.enabled = enabled5; curY += 120f; } else if (_currentTab == 1) { DrawTabCosmetics(num11, ref curY, num10, num12, num13); } else if (_currentTab == 2) { DrawTabPlayerControl(num11, ref curY, num10, num12, num13); } else if (_currentTab == 3) { DrawTabItemControl(num11, ref curY, num10, num12, num13); } else if (_currentTab == 4) { bool enabled6 = GUI.enabled; if (!_cfgModEnabled.Value) { GUI.enabled = false; } string text13 = (UseChinese() ? "\ud83d\udd04 重置全部局内选项" : "\ud83d\udd04 Reset All Visual Settings"); if (GUI.Button(new Rect(num11, curY, num10, 40f), text13, _sBtnRed)) { ResetVisualSettings(); } curY += 52f; float num20 = 120f; Rect val8 = default(Rect); ((Rect)(ref val8))..ctor(num11, curY, num10, num20); GUI.Box(val8, "", _sSection); DrawBorderRect(val8, _texBorder); float num21 = curY + 12f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "\ud83d\udd4a\ufe0f 自由飞行与快捷按键" : "\ud83d\udd4a\ufe0f Free Flight & Hotkeys", _sTitle); num21 += 28f; bool flag8 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgGodModeFlightEnabled.Value, UseChinese() ? "\ud83d\udd4a\ufe0f 上帝飞行模式 [快捷键: G] (开启后可通过 WASD+空格/Ctrl 穿墙上下左右飞行,开启时自动开启无敌)" : "God Flight Mode [Hotkey: G] (Fly freely through walls with WASD+Space/Ctrl, auto-enables God Mode)"); if (flag8 != _cfgGodModeFlightEnabled.Value) { _cfgGodModeFlightEnabled.Value = flag8; SaveRuntimeConfig(); if ((Object)(object)PlayerAvatar.instance != (Object)null) { string text14 = PlayerAvatarSteamIDRef.Invoke(PlayerAvatar.instance); if (!string.IsNullOrEmpty(text14)) { SetPlayerFlightGodMode(text14, flag8); } } } num21 += 38f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "※ 特效均实时生效。无限武器电量仅对本地玩家自己生效。" : "* Effects apply immediately. Infinite Battery only applies to local player.", _sStatus); curY += num20 + 16f; float num22 = 125f; Rect val9 = default(Rect); ((Rect)(ref val9))..ctor(num11, curY, num10, num22); GUI.Box(val9, "", _sSection); DrawBorderRect(val9, _texBorder); num21 = curY + 12f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "\ud83d\udce6 代币装饰箱提取限制" : "\ud83d\udce6 Token Box Extraction Limit", _sTitle); num21 += 28f; bool flag9 = DrawStyledToggle(new Rect(num12, num21, num13, 30f), _cfgLimitCosmeticBoxes.Value, UseChinese() ? "\ud83d\udce6 自定义每局可提取的代币箱上限 (调至11即为无限制)" : "Override Token Box Extraction Limit (Set to 11 for Unlimited)"); GUI.Label(new Rect(num12, num21, num13 - 10f, 30f), UseChinese() ? "⚠\ufe0f 必须全员装Mod才生效 | 无视房主禁用" : "⚠\ufe0f All players need Mod", _sWarningStyle); if (flag9 != _cfgLimitCosmeticBoxes.Value) { _cfgLimitCosmeticBoxes.Value = flag9; SaveRuntimeConfig(); } num21 += 34f; bool enabled7 = GUI.enabled; GUI.enabled = enabled7 && _cfgLimitCosmeticBoxes.Value; int value2 = _cfgLimitCosmeticBoxesValue.Value; string text15 = (UseChinese() ? ("每局提取上限: " + ((value2 == 11) ? "无限制" : (value2 + " 个"))) : ("Max Limit Per Round: " + ((value2 == 11) ? "Unlimited" : value2.ToString()))); GUI.Label(new Rect(num12, num21, 280f, 24f), text15, _sLabel); int num23 = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(num12 + 290f, num21 + 6f, num13 - 290f - 10f, 12f), (float)value2, 1f, 11f, _sSlider, _sThumb)); if (num23 != value2) { _cfgLimitCosmeticBoxesValue.Value = num23; SaveRuntimeConfig(); } GUI.enabled = enabled7; curY += num22 + 16f; float num24 = 120f; Rect val10 = default(Rect); ((Rect)(ref val10))..ctor(num11, curY, num10, num24); GUI.Box(val10, "", _sSection); DrawBorderRect(val10, _texBorder); num21 = curY + 12f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "\ud83d\udd0c 充电箱增强" : "\ud83d\udd0c Charging Station Enhancements", _sTitle); num21 += 28f; bool flag10 = DrawStyledToggle(new Rect(num12, num21, num13, 30f), _cfgInfiniteChargingStation.Value, UseChinese() ? "⚡ 充电箱无限电量 (无需在商店购买水晶即可无限充电)" : "Infinite Charging Station Energy (Recharge batteries without crystals)"); if (flag10 != _cfgInfiniteChargingStation.Value) { _cfgInfiniteChargingStation.Value = flag10; SaveRuntimeConfig(); } num21 += 34f; bool flag11 = DrawStyledToggle(new Rect(num12, num21, num13, 30f), _cfgChargingStationHeal.Value, UseChinese() ? "❤\ufe0f 充电箱恢复血量 (处于充电箱处充电时每秒恢复 5 滴血)" : "Charging Station Healing (Heals 5 HP per second inside charging booth)"); if (flag11 != _cfgChargingStationHeal.Value) { _cfgChargingStationHeal.Value = flag11; SaveRuntimeConfig(); } curY += num24 + 16f; float num25 = 146f; Rect val11 = default(Rect); ((Rect)(ref val11))..ctor(num11, curY, num10, num25); GUI.Box(val11, "", _sSection); DrawBorderRect(val11, _texBorder); num21 = curY + 12f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "⚡ 装备与资源特效" : "⚡ Equipment & Resource Effects", _sTitle); num21 += 28f; bool flag12 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgInfiniteWeaponBattery.Value, UseChinese() ? "⚡ 开启无限电量控制 (允许下方已勾选的分类不消耗电量)" : "Infinite Battery Controller (Enable for checked categories below)"); if (flag12 != _cfgInfiniteWeaponBattery.Value) { _cfgInfiniteWeaponBattery.Value = flag12; SaveRuntimeConfig(); } num21 += 36f; bool enabled8 = GUI.enabled; GUI.enabled = enabled8 && _cfgInfiniteWeaponBattery.Value; float num26 = (num13 - 40f) / 5f; bool flag13 = DrawStyledToggle(new Rect(num12, num21, num26, 30f), _cfgInfBatteryMelee.Value, UseChinese() ? "⚔\ufe0f 近战" : "Melee"); if (flag13 != _cfgInfBatteryMelee.Value) { _cfgInfBatteryMelee.Value = flag13; SaveRuntimeConfig(); } bool flag14 = DrawStyledToggle(new Rect(num12 + num26 + 10f, num21, num26, 30f), _cfgInfBatteryRanged.Value, UseChinese() ? "\ud83d\udd2b 远程" : "Ranged"); if (flag14 != _cfgInfBatteryRanged.Value) { _cfgInfBatteryRanged.Value = flag14; SaveRuntimeConfig(); } bool flag15 = DrawStyledToggle(new Rect(num12 + (num26 + 10f) * 2f, num21, num26, 30f), _cfgInfBatteryVehicles.Value, UseChinese() ? "\ud83c\udfce\ufe0f 载具" : "Vehicles"); if (flag15 != _cfgInfBatteryVehicles.Value) { _cfgInfBatteryVehicles.Value = flag15; SaveRuntimeConfig(); } bool flag16 = DrawStyledToggle(new Rect(num12 + (num26 + 10f) * 3f, num21, num26, 30f), _cfgInfBatteryDrones.Value, UseChinese() ? "\ud83d\udef8 无人机" : "Drones"); if (flag16 != _cfgInfBatteryDrones.Value) { _cfgInfBatteryDrones.Value = flag16; SaveRuntimeConfig(); } bool flag17 = DrawStyledToggle(new Rect(num12 + (num26 + 10f) * 4f, num21, num26, 30f), _cfgInfBatteryTools.Value, UseChinese() ? "\ud83d\udd26 工具" : "Tools"); if (flag17 != _cfgInfBatteryTools.Value) { _cfgInfBatteryTools.Value = flag17; SaveRuntimeConfig(); } GUI.enabled = enabled8; curY += num25 + 16f; float num27 = 270f; Rect val12 = default(Rect); ((Rect)(ref val12))..ctor(num11, curY, num10, num27); GUI.Box(val12, "", _sSection); DrawBorderRect(val12, _texBorder); num21 = curY + 12f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "❌ 怪物滚动珠掉落配置" : "❌ Valuable Shard Drop Configs", _sTitle); num21 += 28f; bool flag18 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgRemovePillarLimit.Value, UseChinese() ? "❌ 取消滚动珠掉落上限 (怪物死亡掉落的滚动珠不再受关卡次数上限及距离限制并无限掉落)" : "Remove Shard Limit (Monsters drop valuable shards upon death without count or distance limits)"); if (flag18 != _cfgRemovePillarLimit.Value) { _cfgRemovePillarLimit.Value = flag18; SaveRuntimeConfig(); } num21 += 34f; bool flag19 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgPillarDropMultiplierEnabled.Value, UseChinese() ? "\ud83d\udcca 开启每个怪物掉落倍率控制 (自定义怪物死亡掉落的滚动珠颗数)" : "Enable Valuable Drop Multiplier (Customize drop count per monster)"); if (flag19 != _cfgPillarDropMultiplierEnabled.Value) { _cfgPillarDropMultiplierEnabled.Value = flag19; SaveRuntimeConfig(); } num21 += 40f; bool enabled9 = GUI.enabled; GUI.enabled = enabled9 && _cfgPillarDropMultiplierEnabled.Value; int num28 = Mathf.RoundToInt(DrawStyledSliderFloat(new Rect(num12, num21, num13, 36f), _cfgPillarDropMultiplier.Value, 1f, 5f, UseChinese() ? "掉落倍率(颗数):" : "Drop Multiplier (count):")); if (num28 != _cfgPillarDropMultiplier.Value) { _cfgPillarDropMultiplier.Value = num28; SaveRuntimeConfig(); } GUI.enabled = enabled9; num21 += 40f; bool flag20 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgTeammateDeathDropBead.Value, UseChinese() ? "\ud83d\udc80 队友死亡掉落滚动珠 (队友死亡后在原地掉落一个小滚动珠)" : "Teammates Drop Shard on Death (Drop a small valuable shard upon teammate death)"); if (flag20 != _cfgTeammateDeathDropBead.Value) { _cfgTeammateDeathDropBead.Value = flag20; if (flag20) { _cfgTeammateReviveDropBead.Value = false; } SaveRuntimeConfig(); } num21 += 34f; bool flag21 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgTeammateReviveDropBead.Value, UseChinese() ? "\ud83d\udc96 队友复活掉落滚动珠 (队友复活后在原地掉落一个小滚动珠)" : "Teammates Drop Shard on Revive (Drop a small valuable shard upon teammate revive)"); if (flag21 != _cfgTeammateReviveDropBead.Value) { _cfgTeammateReviveDropBead.Value = flag21; if (flag21) { _cfgTeammateDeathDropBead.Value = false; } SaveRuntimeConfig(); } num21 += 34f; curY += num27 + 16f; Rect val13 = default(Rect); ((Rect)(ref val13))..ctor(num11, curY, num10, 200f); GUI.Box(val13, "", _sSection); DrawBorderRect(val13, _texBorder); num21 = curY + 12f; bool flag22 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgInfiniteStamina.Value, UseChinese() ? "⚡ 无限体力消耗 (无限跑步与滑行,不累)" : "⚡ Infinite Stamina (Sprint & Slide without draining energy)"); if (flag22 != _cfgInfiniteStamina.Value) { _cfgInfiniteStamina.Value = flag22; SaveRuntimeConfig(); } num21 += 38f; bool flag23 = DrawStyledToggle(new Rect(num12, num21, num13, 34f), _cfgJumpMultiplierEnabled.Value, UseChinese() ? "开启超级大跳 (修改本地玩家起跳力倍数)" : "Enable Super Jump (Modify local player jump force multiplier)"); if (flag23 != _cfgJumpMultiplierEnabled.Value) { _cfgJumpMultiplierEnabled.Value = flag23; SaveRuntimeConfig(); } num21 += 40f; bool enabled10 = GUI.enabled; GUI.enabled = enabled10 && flag23; float num29 = DrawStyledSliderFloat(new Rect(num12, num21, num13, 36f), _cfgJumpMultiplier.Value, 1f, 3f, UseChinese() ? "大跳物理力度倍数:" : "Jump Force Multiplier:"); if (Mathf.Abs(num29 - _cfgJumpMultiplier.Value) > 0.01f) { _cfgJumpMultiplier.Value = num29; SaveRuntimeConfig(); } GUI.enabled = enabled10; num21 += 40f; GUI.Label(new Rect(num12, num21, num13, 24f), UseChinese() ? "※ 超级大跳在本地物理模拟中计算,可助力越过常规手段无法跨越的高墙或深坑。" : "* Super Jump runs on local physics to help clear high walls or deep gaps.", _sStatus); curY += 200f; GUI.enabled = enabled6; } else if (_currentTab == 5) { bool enabled11 = GUI.enabled; if (!IsTab6Enabled() || !flag2) { GUI.enabled = false; } if (_lastTab != 5) { RefreshUpgradeLevelsBuffer(); } float num30 = 54f; Rect val14 = default(Rect); ((Rect)(ref val14))..ctor(num11, curY, num10, num30); GUI.Box(val14, "", _sSection); DrawBorderRect(val14, _texBorder); float num31 = curY + 12f; bool flag24 = DrawStyledToggle(new Rect(num12, num31, num13, 30f), _cfgUpgradeLimitEnabled.Value, UseChinese() ? "\ud83e\uddea 启用升级药水等级限制 (达到上限后喝药水不升级)" : "Enable Upgrade Potion Limit Control"); if (flag24 != _cfgUpgradeLimitEnabled.Value) { _cfgUpgradeLimitEnabled.Value = flag24; SaveRuntimeConfig(); } curY += num30 + 16f; bool enabled12 = GUI.enabled; if (!_cfgUpgradeLimitEnabled.Value) { GUI.enabled = false; } float num32 = num10 * 0.5f - 10f; bool num33 = !string.IsNullOrEmpty(GetCachedLocalSteamID()); bool enabled13 = GUI.enabled; if (!num33) { GUI.enabled = false; } string text16 = (UseChinese() ? "\ud83d\udcbe 保存当前局内等级更改" : "\ud83d\udcbe Save Level Changes"); if (GUI.Button(new Rect(num11, curY, num32, 40f), text16, _sBtnGreen)) { SaveUpgradeLevelsFromBuffer(); } GUI.enabled = enabled13; string text17 = (UseChinese() ? "\ud83d\udd04 重置所有升级限制与等级" : "\ud83d\udd04 Reset All Upgrade Settings"); if (GUI.Button(new Rect(num11 + num10 - num32, curY, num32, 40f), text17, _sBtnRed)) { ResetUpgradeSettings(); RefreshUpgradeLevelsBuffer(); } curY += 52f; float num34 = 630f; Rect val15 = default(Rect); ((Rect)(ref val15))..ctor(num11, curY, num10, num34); GUI.Box(val15, "", _sSection); DrawBorderRect(val15, _texBorder); num31 = curY + 12f; GUI.Label(new Rect(num12, num31, num13, 28f), UseChinese() ? "\ud83e\uddea 本局升级等级控制列表" : "\ud83e\uddea Upgrade Levels & Limits", _sTitle); num31 += 32f; GUI.Label(new Rect(num12, num31, 220f, 26f), UseChinese() ? "升级种类药水名称" : "Upgrade Name", _sHeaderStyle); GUI.Label(new Rect(num12 + 240f, num31, 180f, 26f), UseChinese() ? "局内当前等级" : "Current Level", _sHeaderStyle); GUI.Label(new Rect(num12 + 600f, num31, 220f, 26f), UseChinese() ? "限制最大等级" : "Enable Limit", _sHeaderStyle); GUI.Label(new Rect(num12 + 760f, num31, 180f, 26f), UseChinese() ? "最大限制等级" : "Max Limit", _sHeaderStyle); num31 += 34f; if (!num33) { GUI.Label(new Rect(num12, num31 + 100f, num13, 30f), UseChinese() ? "⚠\ufe0f 等待本地玩家数据初始化后显示等级列表..." : "⚠\ufe0f Waiting for player initialization...", _sLabelLarge); } else { for (int j = 0; j < UpgradeTypes.Length; j++) { string key = UpgradeTypes[j]; string text18 = UpgradeNamesCN[j]; string text19 = UpgradeNamesEN[j]; GUI.Label(new Rect(num12, num31 + 4f, 220f, 28f), UseChinese() ? text18 : text19, _sLabelLarge); string text20 = (_uiLevelsBuffer.ContainsKey(key) ? _uiLevelsBuffer[key] : "0"); string text21 = GUI.TextField(new Rect(num12 + 240f, num31, 100f, 32f), text20, _sInputStyleLarge); if (text21 != text20) { _uiLevelsBuffer[key] = KeepOnlyDigits(text21); } bool flag25 = _uiLimitTogglesBuffer.ContainsKey(key) && _uiLimitTogglesBuffer[key]; bool flag26 = GUI.Toggle(new Rect(num12 + 600f, num31 + 4f, 150f, 28f), flag25, UseChinese() ? "开启限制" : "Limit On", _sToggleStyleLarge); if (flag26 != flag25) { _uiLimitTogglesBuffer[key] = flag26; } string text22 = (_uiLimitValuesBuffer.ContainsKey(key) ? _uiLimitValuesBuffer[key] : "5"); bool enabled14 = GUI.enabled; if (!flag25) { GUI.enabled = false; } string text23 = GUI.TextField(new Rect(num12 + 760f, num31, 100f, 32f), text22, _sInputStyleLarge); if (text23 != text22) { _uiLimitValuesBuffer[key] = KeepOnlyDigits(text23); } GUI.enabled = enabled14; num31 += 40f; } } curY += num34 + 16f; GUI.enabled = enabled12; GUI.enabled = enabled11; } else if (_currentTab == 7) { bool enabled15 = GUI.enabled; if (!IsStaticModEnabled()) { GUI.enabled = false; } string text24 = (UseChinese() ? "\ud83d\udd04 重置全部刷怪选项" : "\ud83d\udd04 Reset All Monster Settings"); if (GUI.Button(new Rect(num11, curY, num10, 40f), text24, _sBtnRed)) { ResetMonsterData(); } curY += 52f; if (!((Object)(object)PlayerController.instance != (Object)null) || !((Object)(object)EnemyDirector.instance != (Object)null)) { Rect val16 = default(Rect); ((Rect)(ref val16))..ctor(num11, curY, num10, 200f); GUI.Box(val16, "", _sSection); DrawBorderRect(val16, _texBorder); float num35 = curY + 50f; GUI.Label(new Rect(num12, num35, num13, 30f), UseChinese() ? "⚠\ufe0f 请在进入游戏局内后再查看刷怪状态监控!" : "⚠\ufe0f Please enter a level session first!", _sTitle); curY += 220f; } else { if ((Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { EnemyDirector.instance.enemiesSpawned.RemoveAll((EnemyParent ep) => (Object)(object)ep == (Object)null || !Object.op_Implicit((Object)(object)ep) || (Object)(object)((Component)ep).gameObject == (Object)null); } List list = (((Object)(object)EnemyDirector.instance != (Object)null) ? EnemyDirector.instance.enemiesSpawned : null); int num36 = list?.Count ?? 0; Rect val17 = default(Rect); ((Rect)(ref val17))..ctor(num11, curY, num10, 183f); GUI.Box(val17, "", _sSection); DrawBorderRect(val17, _texBorder); float num37 = curY + 12f; GUI.Label(new Rect(num12, num37, num13, 24f), UseChinese() ? "\ud83d\udc7e 刷怪倍率与难度增强" : "\ud83d\udc7e Spawn Rate & Difficulty Enhancements", _sTitle); num37 += 28f; bool enabled16 = GUI.enabled; int num38 = DrawStyledSliderInt(new Rect(num12, num37, num13, 36f), Mathf.RoundToInt(_cfgSpawnRateMultiplier.Value), 1, 50, UseChinese() ? "关卡刷怪数量倍率:" : "Level Spawn Multiplier:"); if (Mathf.Abs((float)num38 - _cfgSpawnRateMultiplier.Value) > 0.01f) { _cfgSpawnRateMultiplier.Value = num38; SaveRuntimeConfig(); } num37 += 36f; Rect rect = default(Rect); ((Rect)(ref rect))..ctor(num12, num37, 360f, 24f); string text25 = (UseChinese() ? "每次关卡刷新怪物数据重置" : "Reset Monster Data on Level Load"); bool value3 = _cfgResetMonsterDataOnLevelLoad.Value; bool flag27 = DrawStyledToggle(rect, value3, text25); if (flag27 != value3) { _cfgResetMonsterDataOnLevelLoad.Value = flag27; SaveRuntimeConfig(); } num37 += 30f; Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(num12, num37, num13, 24f); string text26 = (UseChinese() ? "⚡ 全局动作/过载下限 (开启后所有怪物的动作速度和过载倍率不低于 0.1x,防止怪物完全冻结)" : "⚡ Global Action/Overcharge Floor (Clamp all monsters' action & overcharge multipliers >= 0.1x)"); bool value4 = _cfgLimitActionAndOvercharge.Value; bool flag28 = DrawStyledToggle(rect2, value4, text26); if (flag28 != value4) { _cfgLimitActionAndOvercharge.Value = flag28; SaveRuntimeConfig(); } GUI.enabled = enabled16; num37 += 28f; GUI.Label(new Rect(num12, num37, num13, 24f), UseChinese() ? "※ 控制关卡初始生成的怪物槽总数量(切关时生效)以及已生成槽位的倒计时刷新速度(实时生效)。" : "* Multiplies the initial spawn slot count (takes effect next level) and reduces spawn cooldowns (real-time).", _sStatus); curY += 200f; if (!_globalOverrideInited && list != null && list.Count > 0) { EnemyParent val18 = list[0]; if ((Object)(object)val18 != (Object)null) { _globalDespawnMin = val18.DespawnedTimeMin; _globalDespawnMax = val18.DespawnedTimeMax; _globalSpawnMin = val18.SpawnedTimeMin; _globalSpawnMax = val18.SpawnedTimeMax; _originalDespawnMin = val18.DespawnedTimeMin; _originalDespawnMax = val18.DespawnedTimeMax; _originalSpawnMin = val18.SpawnedTimeMin; _originalSpawnMax = val18.SpawnedTimeMax; _globalOverrideInited = true; } } Rect val19 = default(Rect); ((Rect)(ref val19))..ctor(num11, curY, num10, 392f); GUI.Box(val19, "", _sSection); DrawBorderRect(val19, _texBorder); float num39 = curY + 12f; GUI.Label(new Rect(num12, num39, num13, 24f), UseChinese() ? "\ud83d\udc7e 怪物导演 (EnemyDirector) 全局状态" : "\ud83d\udc7e Global Enemy Director Status", _sTitle); num39 += 26f; float num40 = 0f; try { num40 = EnemyDirectorSpawnIdlePauseTimerRef.Invoke(EnemyDirector.instance); } catch { } string text27 = (UseChinese() ? $"全局生成暂停计时: {num40:F1} 秒 | 怪物槽总数: {num36}" : $"Spawn Idle Pause: {num40:F1}s | Total Slots: {num36}"); GUI.Label(new Rect(num12, num39, num13, 24f), text27, _sLabel); float num41 = curY + 65f; bool enabled17 = GUI.enabled; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "全局最小刷新:" : "Global Min Spawn:", _sLabel); float num42 = GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), _globalDespawnMin, 1f, 300f, _sSlider, _sThumb); if (Mathf.Abs(num42 - _globalDespawnMin) > 0.01f) { _globalDespawnMin = Mathf.Round(num42 * 10f) / 10f; foreach (EnemyParent item in list) { if ((Object)(object)item != (Object)null) { item.DespawnedTimeMin = _globalDespawnMin; } } } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{_globalDespawnMin:F1}s", _sToggleOn); num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "全局最大刷新:" : "Global Max Spawn:", _sLabel); float num43 = GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), _globalDespawnMax, 1f, 300f, _sSlider, _sThumb); if (Mathf.Abs(num43 - _globalDespawnMax) > 0.01f) { _globalDespawnMax = Mathf.Round(num43 * 10f) / 10f; if (_globalDespawnMax < _globalDespawnMin) { _globalDespawnMax = _globalDespawnMin; } foreach (EnemyParent item2 in list) { if ((Object)(object)item2 != (Object)null) { item2.DespawnedTimeMax = _globalDespawnMax; } } } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{_globalDespawnMax:F1}s", _sToggleOn); num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "全局最小寿命:" : "Global Min Life:", _sLabel); float num44 = GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), _globalSpawnMin, 1f, 600f, _sSlider, _sThumb); if (Mathf.Abs(num44 - _globalSpawnMin) > 0.01f) { _globalSpawnMin = Mathf.Round(num44 * 10f) / 10f; foreach (EnemyParent item3 in list) { if ((Object)(object)item3 != (Object)null) { item3.SpawnedTimeMin = _globalSpawnMin; } } } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{_globalSpawnMin:F1}s", _sToggleOn); num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "全局最大寿命:" : "Global Max Life:", _sLabel); float num45 = GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), _globalSpawnMax, 1f, 600f, _sSlider, _sThumb); if (Mathf.Abs(num45 - _globalSpawnMax) > 0.01f) { _globalSpawnMax = Mathf.Round(num45 * 10f) / 10f; if (_globalSpawnMax < _globalSpawnMin) { _globalSpawnMax = _globalSpawnMin; } foreach (EnemyParent item4 in list) { if ((Object)(object)item4 != (Object)null) { item4.SpawnedTimeMax = _globalSpawnMax; } } } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{_globalSpawnMax:F1}s", _sToggleOn); float num46 = num12 + 460f; float num47 = num13 - 460f; if (num47 < 200f) { num47 = 280f; } string text28 = (UseChinese() ? "⚡ 强制全体出生" : "⚡ Force All Spawns"); if (GUI.Button(new Rect(num46, curY + 55f, num47, 32f), text28, _sBtnGreen)) { try { EnemyDirectorSpawnIdlePauseTimerRef.Invoke(EnemyDirector.instance) = 0f; } catch { } if (list != null) { foreach (EnemyParent item5 in list) { if ((Object)(object)item5 != (Object)null && !EnemyParentSpawnedRef.Invoke(item5)) { item5.DespawnedTimerSet(0f, false); } } } } string text29 = (UseChinese() ? "\ud83d\udc80 全局一键击杀" : "\ud83d\udc80 Kill All Enemies"); if (GUI.Button(new Rect(num46, curY + 95f, num47, 32f), text29, _sBtnRed) && list != null) { foreach (EnemyParent item6 in list) { if (!((Object)(object)item6 != (Object)null) || !EnemyParentSpawnedRef.Invoke(item6)) { continue; } Enemy val20 = EnemyParentEnemyRef.Invoke(item6); if (!((Object)(object)val20 != (Object)null)) { continue; } EnemyHealth val21 = EnemyHealthRef.Invoke(val20); if ((Object)(object)val21 != (Object)null) { try { val21.Hurt(9999, Vector3.zero); } catch { } } } } string text30 = (UseChinese() ? "\ud83d\udca5 强制全体消失" : "\ud83d\udca5 Force All Despawns"); if (GUI.Button(new Rect(num46, curY + 135f, num47, 32f), text30, _sBtnRed) && list != null) { foreach (EnemyParent item7 in list) { if ((Object)(object)item7 != (Object)null && EnemyParentSpawnedRef.Invoke(item7)) { try { item7.Despawn(); } catch { } } } } bool enabled18 = GUI.enabled; if (_isTeleporting) { GUI.enabled = false; } string text31 = (UseChinese() ? "\ud83d\udccd 全体拉到面前" : "\ud83d\udccd Pull All Enemies"); if (GUI.Button(new Rect(num46, curY + 175f, num47, 32f), text31, _sBtnNormal) && list != null && (Object)(object)PlayerController.instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(PullAllEnemiesCoroutine(list, ((Component)PlayerController.instance).transform.position, ((Component)PlayerController.instance).transform.forward)); } GUI.enabled = enabled18; bool enabled19 = GUI.enabled; if (_isTeleporting) { GUI.enabled = false; } string text32 = (UseChinese() ? "\ud83c\udfb2 全体随机分布" : "\ud83c\udfb2 Random Scatter Enemies"); if (GUI.Button(new Rect(num46, curY + 215f, num47, 32f), text32, _sBtnNormal) && list != null) { List scatterPoints = GetScatterPoints(); if (scatterPoints.Count > 0) { foreach (EnemyParent item8 in list) { if (!((Object)(object)item8 != (Object)null) || !EnemyParentSpawnedRef.Invoke(item8)) { continue; } Enemy val22 = EnemyParentEnemyRef.Invoke(item8); if ((Object)(object)val22 != (Object)null) { int index = Random.Range(0, scatterPoints.Count); Vector3 position = scatterPoints[index] + Vector3.up * 0.5f; try { TeleportEnemy(val22, position); } catch { } } } } } GUI.enabled = enabled19; string text33 = (UseChinese() ? "❌ 一键移除所有刷新" : "❌ Clear All Spawns"); if (GUI.Button(new Rect(num46, curY + 255f, num47, 32f), text33, _sBtnRed) && list != null) { List list2 = new List(list); try { EnemyDirector.instance.enemiesSpawned.Clear(); } catch { } foreach (EnemyParent item9 in list2) { if ((Object)(object)item9 == (Object)null) { continue; } try { item9.Despawn(); } catch { } try { if ((Object)(object)((Component)item9).gameObject != (Object)null) { if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { PhotonNetwork.Destroy(((Component)item9).gameObject); } else if (!PhotonNetwork.InRoom) { Object.Destroy((Object)(object)((Component)item9).gameObject); } } } catch { } } } num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "全局体积:" : "Global Scale:", _sLabel); float num48 = 1f; int num49 = 0; float num50 = 0f; if (list != null) { foreach (EnemyParent item10 in list) { if ((Object)(object)item10 != (Object)null && EnemyParentSpawnedRef.Invoke(item10)) { num50 += ((Component)item10).transform.localScale.x; num49++; } } } if (num49 > 0) { num48 = num50 / (float)num49; } float num51 = Mathf.Round(GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), num48, 0.1f, 5f, _sSlider, _sThumb) * 10f) / 10f; if (Mathf.Abs(num51 - num48) > 0.05f && list != null) { foreach (EnemyParent item11 in list) { if ((Object)(object)item11 != (Object)null && EnemyParentSpawnedRef.Invoke(item11)) { SetEnemyScale(item11, num51); } } } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{num51:F1}x", _sToggleOn); num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "拉怪时间间隔:" : "Pull Interval:", _sLabel); float num52 = ((_cfgEnemyPullInterval != null) ? _cfgEnemyPullInterval.Value : 0.1f); float num53 = Mathf.Round(GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), num52, 0.1f, 2f, _sSlider, _sThumb) * 10f) / 10f; if (Mathf.Abs(num53 - num52) > 0.01f && _cfgEnemyPullInterval != null) { _cfgEnemyPullInterval.Value = num53; SaveRuntimeConfig(); } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{num53:F1}s", _sToggleOn); num41 += 38f; GUI.Label(new Rect(num12, num41, 160f, 24f), UseChinese() ? "拉怪距离:" : "Pull Distance:", _sLabel); float num54 = ((_cfgEnemyPullDistance != null) ? _cfgEnemyPullDistance.Value : 3f); float num55 = Mathf.Round(GUI.HorizontalSlider(new Rect(num12 + 170f, num41 + 8f, 200f, 20f), num54, 3f, 30f, _sSlider, _sThumb) * 10f) / 10f; if (Mathf.Abs(num55 - num54) > 0.1f && _cfgEnemyPullDistance != null) { _cfgEnemyPullDistance.Value = num55; SaveRuntimeConfig(); } GUI.Label(new Rect(num12 + 380f, num41, 60f, 24f), $"{num55:F1}m", _sToggleOn); num46 = num12 + 460f; num47 = num13 - 460f; if (num47 < 200f) { num47 = 280f; } string text34 = (UseChinese() ? "\ud83d\udcd0 重置全部体积" : "\ud83d\udcd0 Reset All Scale"); if (GUI.Button(new Rect(num46, curY + 335f, num47, 32f), text34, _sBtnNormal) && list != null) { foreach (EnemyParent item12 in list) { if ((Object)(object)item12 != (Object)null) { SetEnemyScale(item12, 1f); } } } GUI.enabled = enabled17; string text35 = (UseChinese() ? "\ud83d\udd04 刷新/重读数据" : "\ud83d\udd04 Refresh Data"); if (GUI.Button(new Rect(num46, curY + 295f, num47, 32f), text35, _sBtnNormal)) { _globalOverrideInited = false; if ((Object)(object)EnemyDirector.instance != (Object)null) { EnemyParent[] array2 = Object.FindObjectsOfType(true); List list3 = new List(); EnemyParent[] array3 = array2; foreach (EnemyParent val23 in array3) { if ((Object)(object)val23 != (Object)null && (Object)(object)((Component)val23).gameObject != (Object)null && !list3.Contains(val23)) { list3.Add(val23); } } EnemyDirector.instance.enemiesSpawned = list3; } Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogInfo((object)"[GameTools] Reloaded/refreshed enemy settings from live game."); } } curY += 450f; int num57 = 0; int num58 = 0; if (list != null) { foreach (EnemyParent item13 in list) { if ((Object)(object)item13 != (Object)null) { if (EnemyParentSpawnedRef.Invoke(item13)) { num57++; } else { num58++; } } } } new Rect(num11, curY, num10, 36f); string[] array4 = ((!UseChinese()) ? new string[2] { $"\ud83d\udfe2 Alive Enemies ({num57})", $"\ud83d\udd34 Despawned Slots ({num58})" } : new string[2] { $"\ud83d\udfe2 存活怪物列表 (共 {num57} 只)", $"\ud83d\udd34 待刷槽位列表 (共 {num58} 个)" }); float num59 = num10 / 2f; for (int num60 = 0; num60 < 2; num60++) { bool flag29 = _monsterSubTab == num60; if (GUI.Button(new Rect(num11 + (float)num60 * num59, curY, num59 - 4f, 32f), array4[num60], flag29 ? _sBtnGreen : _sBtnNormal)) { _monsterSubTab = num60; } } curY += 44f; if (num36 == 0) { Rect val24 = default(Rect); ((Rect)(ref val24))..ctor(num11, curY, num10, 100f); GUI.Box(val24, "", _sSection); DrawBorderRect(val24, _texBorder); GUI.Label(new Rect(num12, curY + 36f, num13, 24f), UseChinese() ? "当前地图尚未加载任何怪物槽..." : "No enemy slots loaded in the current level...", _sLabel); curY += 120f; } else { int num61 = 0; Rect val26 = default(Rect); for (int num62 = 0; num62 < num36; num62++) { EnemyParent val25 = list[num62]; if ((Object)(object)val25 == (Object)null || !Object.op_Implicit((Object)(object)val25) || (Object)(object)((Component)val25).gameObject == (Object)null) { continue; } try { bool flag30 = EnemyParentSpawnedRef.Invoke(val25); if ((_monsterSubTab == 0 && !flag30) || (_monsterSubTab == 1 && flag30)) { continue; } num61++; float num63 = ((_monsterSubTab == 0) ? 220f : 130f); ((Rect)(ref val26))..ctor(num11, curY, num10, num63); GUI.Box(val26, "", _sSection); DrawBorderRect(val26, _texBorder); string value5; if (UseChinese()) { if (!_enemyNameCacheCN.TryGetValue(val25, out value5)) { value5 = EnemyNameLocalizer.Translate((val25.enemyName ?? "").Replace("Enemy - ", "").Replace("Enemy ", "")); _enemyNameCacheCN.Add(val25, value5); } } else if (!_enemyNameCacheEN.TryGetValue(val25, out value5)) { value5 = (val25.enemyName ?? "").Replace("Enemy - ", "").Replace("Enemy ", ""); _enemyNameCacheEN.Add(val25, value5); } Enemy val27 = EnemyParentEnemyRef.Invoke(val25); EnemyHealth val28 = null; if ((Object)(object)val27 != (Object)null) { val28 = EnemyHealthRef.Invoke(val27); } float num64 = num12; float num65 = num12 + 250f; float num66 = num12 + num13 - 150f; if (_monsterSubTab == 0) { int num67 = (((Object)(object)val28 != (Object)null) ? EnemyHealthCurrentRef.Invoke(val28) : 0); int num68 = (((Object)(object)val28 != (Object)null) ? val28.health : 0); string text36 = (((Object)(object)val28 != (Object)null) ? $"❤\ufe0f HP: {num67}/{num68}" : "❤\ufe0f HP: --/--"); GUI.Label(new Rect(num64, curY + 12f, 240f, 24f), $"[{num62 + 1}] {value5}", _sTitle); GUI.Label(new Rect(num64, curY + 42f, 240f, 24f), text36, ((float)num67 < (float)num68 * 0.3f) ? _sBtnRed : _sStatus); GUI.Label(new Rect(num64, curY + 70f, 240f, 24f), UseChinese() ? $"⏱\ufe0f 已活: {val25.SpawnedTimer:F1}秒" : $"⏱\ufe0f Life: {val25.SpawnedTimer:F1}s", _sLabel); GUI.Label(new Rect(num64, curY + 98f, 240f, 24f), UseChinese() ? $"⚙\ufe0f 难度: {val25.difficulty}" : $"⚙\ufe0f Diff: {val25.difficulty}", _sLabel); bool flag31 = EnemyParentPlayerCloseRef.Invoke(val25); string text37 = ((!flag31) ? (UseChinese() ? "\ud83c\udf43 四下无人" : "\ud83c\udf43 Empty Area") : (UseChinese() ? "\ud83d\udc65 玩家在旁" : "\ud83d\udc65 Player Near")); GUI.Label(new Rect(num64, curY + 126f, 240f, 24f), text37, flag31 ? _sStatus : _sLabel); float num69 = num65 + 130f; float num70 = num12 + num13 - 210f; float num71 = num70 - num69 - 10f; GUI.Label(new Rect(num65, curY + 12f, 120f, 24f), UseChinese() ? "最小寿命:" : "Min Life:", _sLabel); float num72 = GUI.HorizontalSlider(new Rect(num69, curY + 18f, num71, 20f), val25.SpawnedTimeMin, 1f, 600f, _sSlider, _sThumb); val25.SpawnedTimeMin = Mathf.Round(num72 * 10f) / 10f; GUI.Label(new Rect(num70, curY + 12f, 50f, 24f), $"{val25.SpawnedTimeMin:F0}s", _sToggleOn); GUI.Label(new Rect(num65, curY + 54f, 120f, 24f), UseChinese() ? "最大寿命:" : "Max Life:", _sLabel); float num73 = GUI.HorizontalSlider(new Rect(num69, curY + 60f, num71, 20f), val25.SpawnedTimeMax, 1f, 600f, _sSlider, _sThumb); val25.SpawnedTimeMax = Mathf.Round(num73 * 10f) / 10f; if (val25.SpawnedTimeMax < val25.SpawnedTimeMin) { val25.SpawnedTimeMax = val25.SpawnedTimeMin; } GUI.Label(new Rect(num70, curY + 54f, 50f, 24f), $"{val25.SpawnedTimeMax:F0}s", _sToggleOn); GUI.Label(new Rect(num65, curY + 96f, 120f, 24f), UseChinese() ? "动作速度:" : "Action Spd:", _sLabel); float num74 = GUI.HorizontalSlider(new Rect(num69, curY + 102f, num71, 20f), val25.actionMultiplier, 0.1f, 5f, _sSlider, _sThumb); val25.actionMultiplier = Mathf.Round(num74 * 10f) / 10f; GUI.Label(new Rect(num70, curY + 96f, 50f, 24f), $"{val25.actionMultiplier:F1}x", _sToggleOn); GUI.Label(new Rect(num65, curY + 138f, 120f, 24f), UseChinese() ? "过载倍率:" : "Overcharge:", _sLabel); float num75 = GUI.HorizontalSlider(new Rect(num69, curY + 144f, num71, 20f), val25.overchargeMultiplier, 0.1f, 5f, _sSlider, _sThumb); val25.overchargeMultiplier = Mathf.Round(num75 * 10f) / 10f; GUI.Label(new Rect(num70, curY + 138f, 50f, 24f), $"{val25.overchargeMultiplier:F1}x", _sToggleOn); float num76 = 140f; float num77 = 32f; float num78 = curY + 12f; bool enabled20 = GUI.enabled; if (_isTeleporting) { GUI.enabled = false; } if (GUI.Button(new Rect(num66, num78, num76, num77), UseChinese() ? "\ud83d\udccd 拉到面前" : "\ud83d\udccd Pull", _sBtnNormal) && (Object)(object)val27 != (Object)null && (Object)(object)PlayerController.instance != (Object)null) { try { Vector3 spawnPosition = GetSpawnPosition((_cfgEnemyPullDistance != null) ? _cfgEnemyPullDistance.Value : 3f); TeleportEnemy(val27, spawnPosition); } catch { } } GUI.enabled = enabled20; num78 += 38f; bool enabled21 = GUI.enabled; if (_isTeleporting) { GUI.enabled = false; } if (GUI.Button(new Rect(num66, num78, num76, num77), UseChinese() ? "✈\ufe0f 飞过去" : "✈\ufe0f Goto", _sBtnNormal) && (Object)(object)val27 != (Object)null && (Object)(object)PlayerController.instance != (Object)null) { try { Vector3 position2 = ((Component)val27).transform.position + Vector3.up * 0.5f; PlayerAvatar val29 = (((Object)(object)PlayerController.instance.playerAvatarScript != (Object)null) ? ((Component)PlayerController.instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val29 != (Object)null) { TeleportPlayer(val29, position2); } } catch { } } GUI.enabled = enabled21; num78 += 38f; if (GUI.Button(new Rect(num66, num78, num76, num77), UseChinese() ? "⚡ 一键击杀" : "⚡ Kill Enemy", _sBtnRed) && (Object)(object)val28 != (Object)null) { try { val28.Hurt(9999, Vector3.zero); } catch { } } num78 += 38f; if (GUI.Button(new Rect(num66, num78, num76, num77), UseChinese() ? "\ud83d\udca5 强制消失" : "\ud83d\udca5 Despawn", _sBtnRed)) { try { val25.Despawn(); } catch { } } num78 += 38f; if (GUI.Button(new Rect(num66, num78, num76, num77), UseChinese() ? "❌ 移除刷新" : "❌ Remove", _sBtnRed)) { try { val25.Despawn(); } catch { } try { EnemyDirector.instance.enemiesSpawned.Remove(val25); } catch { } } } else { GUI.Label(new Rect(num64, curY + 12f, 240f, 24f), $"[{num62 + 1}] {value5}", _sTitle); GUI.Label(new Rect(num64, curY + 42f, 240f, 24f), UseChinese() ? $"\ud83d\udc80 炸裂刷新: {val25.DespawnedTimer:F1}s" : $"\ud83d\udc80 Spawn In: {val25.DespawnedTimer:F1}s", _sBtnRed); GUI.Label(new Rect(num64, curY + 70f, 240f, 24f), UseChinese() ? $"⚙\ufe0f 难度: {val25.difficulty}" : $"⚙\ufe0f Diff: {val25.difficulty}", _sLabel); float num79 = num65 + 130f; float num80 = num12 + num13 - 210f; float num81 = num80 - num79 - 10f; GUI.Label(new Rect(num65, curY + 22f, 120f, 24f), UseChinese() ? "最小刷新:" : "Min Spawn:", _sLabel); float num82 = GUI.HorizontalSlider(new Rect(num79, curY + 28f, num81, 20f), val25.DespawnedTimeMin, 1f, 300f, _sSlider, _sThumb); val25.DespawnedTimeMin = Mathf.Round(num82 * 10f) / 10f; GUI.Label(new Rect(num80, curY + 22f, 50f, 24f), $"{val25.DespawnedTimeMin:F0}s", _sToggleOn); GUI.Label(new Rect(num65, curY + 70f, 120f, 24f), UseChinese() ? "最大刷新:" : "Max Spawn:", _sLabel); float num83 = GUI.HorizontalSlider(new Rect(num79, curY + 76f, num81, 20f), val25.DespawnedTimeMax, 1f, 300f, _sSlider, _sThumb); val25.DespawnedTimeMax = Mathf.Round(num83 * 10f) / 10f; if (val25.DespawnedTimeMax < val25.DespawnedTimeMin) { val25.DespawnedTimeMax = val25.DespawnedTimeMin; } GUI.Label(new Rect(num80, curY + 70f, 50f, 24f), $"{val25.DespawnedTimeMax:F0}s", _sToggleOn); float num84 = 140f; float num85 = 32f; float num86 = curY + 22f; if (GUI.Button(new Rect(num66, num86, num84, num85), UseChinese() ? "⚡ 立即出生" : "⚡ Spawn Now", _sBtnGreen)) { val25.DespawnedTimerSet(0f, false); } num86 += 42f; if (GUI.Button(new Rect(num66, num86, num84, num85), UseChinese() ? "❌ 移除刷新" : "❌ Remove", _sBtnRed)) { try { EnemyDirector.instance.enemiesSpawned.Remove(val25); } catch { } } } curY += num63 + 16f; } catch (Exception arg3) { Plugin instance4 = Instance; if (instance4 != null) { ((BaseUnityPlugin)instance4).Logger.LogWarning((object)$"[DrawMonsterCard Error] Index {num62}: {arg3}"); } } } if (num61 == 0) { Rect val30 = default(Rect); ((Rect)(ref val30))..ctor(num11, curY, num10, 100f); GUI.Box(val30, "", _sSection); DrawBorderRect(val30, _texBorder); string text38 = ((_monsterSubTab != 0) ? (UseChinese() ? "当前地图没有待刷新的怪物槽。" : "No despawned enemy slots.") : (UseChinese() ? "当前地图没有任何存活的怪物。" : "No alive enemies in the level.")); GUI.Label(new Rect(num12, curY + 36f, num13, 24f), text38, _sLabel); curY += 120f; } } } _lastVirtualHeight = curY + 20f; GUI.enabled = enabled15; } _lastVirtualHeight = curY + 20f; GUI.EndScrollView(); } if (_showConfirmSpawn && _pendingSpawnInfo != null) { DrawConfirmSpawnDialog(); } else if (_showConfirmKillAllTeammates) { DrawConfirmKillAllTeammatesDialog(); } _lastTab = _currentTab; GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width - 50f, 30f)); } private void DrawTabSpawner(Rect viewRect) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) float x = ((Rect)(ref viewRect)).x; float y = ((Rect)(ref viewRect)).y; float width = ((Rect)(ref viewRect)).width; float height = ((Rect)(ref viewRect)).height; if (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient) { string text = (UseChinese() ? "⚠\ufe0f 联机模式下客机已禁用刷取助手,只有房主可用!" : "⚠\ufe0f Spawner is disabled for clients in multiplayer, only the host can use it!"); GUI.Label(new Rect(x + 20f, y + height * 0.4f, width - 40f, 60f), text, _sTitle); return; } LoadAllSpawnables(force: false); string text2 = (UseChinese() ? "\ud83d\udd04 重置全部刷取选项" : "\ud83d\udd04 Reset All Spawner Settings"); if (GUI.Button(new Rect(x, y, width, 40f), text2, _sBtnRed)) { _spawnCount = 1; _spawnCountStr = "1"; _cfgSpawnedAutoRespawn = false; _cfgSpawnedDelayPull = false; if (_cfgSpawnDistance != null) { _cfgSpawnDistance.Value = 1f; } SaveRuntimeConfig(); } y += 52f; height -= 52f; Rect val = default(Rect); ((Rect)(ref val))..ctor(x, y, 200f, height); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); string[] array = ((!UseChinese()) ? new string[13] { "\ud83d\udc7e Enemies", "\ud83c\udfa8 Custom Enemies", "\ud83d\udc8e Valuables", "\ud83c\udf81 Cosmetic Boxes", "\ud83e\uddea Potions", "⚔\ufe0f Melee", "\ud83d\udd2b Ranged", "\ud83d\udca3 Others", "\ud83d\uded2 Carts", "\ud83c\udfce\ufe0f Vehicles", "\ud83d\udef8 Drones", "\ud83d\udce6 Other Items", "\ud83c\udfa8 Custom Items" } : new string[13] { "\ud83d\udc7e 危险怪物", "\ud83c\udfa8 自定怪物", "\ud83d\udc8e 贵重物品", "\ud83c\udf81 代币箱子", "\ud83e\uddea 升级药水", "⚔\ufe0f 近战武器", "\ud83d\udd2b 远程武器", "\ud83d\udca3 其他装备", "\ud83d\uded2 运载推车", "\ud83c\udfce\ufe0f 赛车交通", "\ud83d\udef8 无人机装备", "\ud83d\udce6 其它道具", "\ud83c\udfa8 自定物品" }); float num = y + 12f; float num2 = 36f; float num3 = 6f; for (int i = 0; i < 13; i++) { bool flag = _currentSubTab == i; if (GUI.Button(new Rect(x + 10f, num, 180f, num2), array[i], flag ? _sBtnGreen : _sBtnNormal)) { _currentSubTab = i; } num += num2 + num3; } if (GUI.Button(new Rect(x + 10f, y + height - 56f, 180f, 44f), UseChinese() ? "\ud83d\udd04 刷新数据" : "\ud83d\udd04 Refresh", _sBtnNormal)) { LoadAllSpawnables(force: true); } float num4 = x + 215f; float num5 = width - 215f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num4, y, num5, height); GUI.Box(val2, "", _sSection); DrawBorderRect(val2, _texBorder); if (!((Object)(object)PlayerController.instance != (Object)null)) { string text3 = (UseChinese() ? "⚠\ufe0f 请在进入游戏局内后再使用刷取助手!" : "⚠\ufe0f Please enter a game level/lobby first!"); GUI.Label(new Rect(num4 + 20f, y + height * 0.4f, num5 - 40f, 40f), text3, _sTitle); return; } float num6 = y + 12f; GUI.Label(new Rect(num4 + 16f, num6 + 4f, 80f, 30f), UseChinese() ? "生成数量:" : "Spawn Qty:", _sLabel); if (_spawnCountStr == null) { _spawnCountStr = _spawnCount.ToString(); } _spawnCountStr = GUI.TextField(new Rect(num4 + 100f, num6, 80f, 30f), _spawnCountStr, _sTextInput); if (GUI.Button(new Rect(num4 + 190f, num6, 34f, 30f), "-", _sBtnNormal)) { if (int.TryParse(_spawnCountStr, out var result)) { _spawnCount = Mathf.Clamp(result, 1, 100); } _spawnCount = Mathf.Max(1, _spawnCount - 1); _spawnCountStr = _spawnCount.ToString(); } if (GUI.Button(new Rect(num4 + 230f, num6, 34f, 30f), "+", _sBtnNormal)) { if (int.TryParse(_spawnCountStr, out var result2)) { _spawnCount = Mathf.Clamp(result2, 1, 100); } _spawnCount = Mathf.Min(100, _spawnCount + 1); _spawnCountStr = _spawnCount.ToString(); } int[] array2 = new int[7] { 1, 5, 10, 20, 30, 40, 50 }; for (int j = 0; j < array2.Length; j++) { int spawnCount = array2[j]; if (GUI.Button(new Rect(num4 + 274f + (float)j * 37f, num6, 32f, 30f), spawnCount.ToString(), _sQuickBtnStyle)) { _spawnCount = spawnCount; _spawnCountStr = spawnCount.ToString(); } } if (_currentSubTab == 0 || _currentSubTab == 1) { Rect rect = default(Rect); ((Rect)(ref rect))..ctor(num4 + 16f, num6 + 36f, 250f, 30f); string text4 = (UseChinese() ? "跟随游戏自动重生" : "Auto Respawn"); _cfgSpawnedAutoRespawn = DrawStyledToggle(rect, _cfgSpawnedAutoRespawn, text4); Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(num4 + 280f, num6 + 36f, 250f, 30f); string text5 = (UseChinese() ? "延迟传送到面前" : "Delay Pull to Front"); _cfgSpawnedDelayPull = DrawStyledToggle(rect2, _cfgSpawnedDelayPull, text5); } float num7 = num6 + ((_currentSubTab == 0 || _currentSubTab == 1) ? 68f : 36f); GUI.Label(new Rect(num4 + 16f, num7 + 4f, 80f, 30f), UseChinese() ? "刷出距离:" : "Spawn Dist:", _sLabel); float num8 = ((_cfgSpawnDistance != null) ? _cfgSpawnDistance.Value : 3f); float num9 = Mathf.Round(GUI.HorizontalSlider(new Rect(num4 + 100f, num7 + 8f, 180f, 20f), num8, 1f, 20f, _sSlider, _sThumb) * 10f) / 10f; if (Mathf.Abs(num9 - num8) > 0.1f && _cfgSpawnDistance != null) { _cfgSpawnDistance.Value = num9; SaveRuntimeConfig(); } GUI.Label(new Rect(num4 + 290f, num7 + 4f, 60f, 30f), $"{num9:F1}m", _sToggleOn); List list = ((_currentSubTab == 0) ? _spawnablesEnemies : ((_currentSubTab == 1) ? _spawnablesCustomEnemies : ((_currentSubTab == 2) ? _spawnablesValuables : ((_currentSubTab == 3) ? _spawnablesCosmeticBoxes : ((_currentSubTab == 4) ? _spawnablesPotions : ((_currentSubTab == 5) ? _spawnablesMelee : ((_currentSubTab == 6) ? _spawnablesRanged : ((_currentSubTab == 7) ? _spawnablesOtherWeapons : ((_currentSubTab == 8) ? _spawnablesCarts : ((_currentSubTab == 9) ? _spawnablesVehicles : ((_currentSubTab == 10) ? _spawnablesDrones : ((_currentSubTab == 11) ? _spawnablesOthers : _spawnablesCustomItems)))))))))))); if (list == null || list.Count == 0) { string text6 = (UseChinese() ? "没有拉取到该类型的资产。请尝试点击左侧的【刷新数据】。" : "No assets found for this category. Try clicking [Refresh]."); GUI.Label(new Rect(num4 + 20f, y + height * 0.4f, num5 - 40f, 40f), text6, _sLabel); return; } int num10 = 3; float num11 = 12f; float num12 = 10f; float num13 = (num5 - (float)(num10 - 1) * num11 - 24f) / (float)num10; float num14 = 46f; float num15 = (float)Mathf.CeilToInt((float)list.Count / (float)num10) * (num14 + num12) + 24f; float num16 = ((_currentSubTab == 0 || _currentSubTab == 1) ? 112f : 80f); float num17 = y + num16; float num18 = height - (num16 + 10f); Rect val3 = new Rect(num4 + 10f, num17, num5 - 20f, num18); Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(0f, 0f, num5 - 36f, num15); _subScrollPos = GUI.BeginScrollView(val3, _subScrollPos, val4); for (int k = 0; k < list.Count; k++) { int num19 = k / num10; float num20 = (float)(k % num10) * (num13 + num11); float num21 = (float)num19 * (num14 + num12); SpawnableInfo spawnableInfo = list[k]; string displayName = spawnableInfo.GetDisplayName(); if (GUI.Button(new Rect(num20, num21, num13, num14), displayName, _sBtnNormal)) { if (int.TryParse(_spawnCountStr, out var result3)) { _spawnCount = Mathf.Clamp(result3, 1, 100); } else { _spawnCount = 1; } _spawnCountStr = _spawnCount.ToString(); if (_spawnCount > 1) { _showConfirmSpawn = true; _pendingSpawnInfo = spawnableInfo; } else { SpawnObject(spawnableInfo); } } } GUI.EndScrollView(); } private static string GetPlayerDisplayName(PlayerAvatar player) { if ((Object)(object)player == (Object)null) { if (!UseChinese()) { return "Unknown Player"; } return "未知玩家"; } try { string text = PlayerAvatarPlayerNameRef.Invoke(player); if (!string.IsNullOrWhiteSpace(text)) { return text.Trim(); } } catch { } try { PhotonView photonView = player.photonView; object obj2; if (photonView == null) { obj2 = null; } else { Player owner = photonView.Owner; obj2 = ((owner != null) ? owner.NickName : null); } string text2 = (string)obj2; if (!string.IsNullOrWhiteSpace(text2)) { return text2.Trim(); } } catch { } try { string text3 = SemiFunc.PlayerGetName(player); if (!string.IsNullOrWhiteSpace(text3)) { return text3.Trim(); } } catch { } if (!string.IsNullOrWhiteSpace(((Object)player).name)) { return ((Object)player).name.Replace("(Clone)", string.Empty).Trim(); } if (!UseChinese()) { return "Unknown Player"; } return "未知玩家"; } private static Vector3 GetPlayerPosition(PlayerAvatar player) { //IL_0009: 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_004b: 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_008a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return Vector3.zero; } try { if (PlayerAvatarDeadSetRef.Invoke(player)) { PlayerDeathHead val = PlayerAvatarPlayerDeathHeadRef.Invoke(player); if ((Object)(object)val != (Object)null) { PhysGrabObject val2 = PlayerDeathHeadPhysGrabObjectRef.Invoke(val); if ((Object)(object)val2 != (Object)null) { return val2.centerPoint; } } } } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[GetPlayerPosition Error] {((Object)player).name}: {arg}"); } } return ((Component)player).transform.position; } private static List GetScatterPoints() { //IL_00e1: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0131: 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_0099: Unknown result type (might be due to invalid IL or missing references) List list = new List(); try { RoomVolume[] array = Object.FindObjectsOfType(); if (array != null && array.Length != 0) { RoomVolume[] array2 = array; foreach (RoomVolume val in array2) { if ((Object)(object)val != (Object)null) { list.Add(((Component)val).transform.position); } } } } catch { } if (list.Count < 3) { try { if ((Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item != (Object)null) { list.Add(((Component)item).transform.position); } } } } catch { } } if (list.Count < 3 && (Object)(object)PlayerController.instance != (Object)null) { Vector3 position = ((Component)PlayerController.instance).transform.position; for (int j = 0; j < 15; j++) { float num = Random.Range(-25f, 25f); float num2 = Random.Range(-25f, 25f); list.Add(new Vector3(position.x + num, position.y + 0.5f, position.z + num2)); } } return list; } private static IEnumerator TeleportPlayersWithDelayCoroutine(List targetAvatars, PlayerTeleportType type) { if (targetAvatars == null || targetAvatars.Count == 0) { yield break; } List scatterPoints = null; if (type == PlayerTeleportType.Scatter) { scatterPoints = GetScatterPoints(); } Vector3 truckPos = Vector3.zero; if (type == PlayerTeleportType.ToTruck) { truckPos = GetTruckPosition(); } for (int i = 0; i < targetAvatars.Count; i++) { PlayerAvatar val = targetAvatars[i]; if ((Object)(object)val != (Object)null) { Vector3 val2 = Vector3.zero; bool flag = false; if (type == PlayerTeleportType.PullToFront) { val2 = GetSpawnPosition(); flag = true; } else if (type == PlayerTeleportType.Scatter && scatterPoints != null && scatterPoints.Count > 0) { int index = Random.Range(0, scatterPoints.Count); val2 = scatterPoints[index] + Vector3.up * 0.5f; flag = true; } else if (type == PlayerTeleportType.ToTruck && truckPos != Vector3.zero) { val2 = truckPos; flag = true; } else if (type == PlayerTeleportType.ToExtractionButton) { ExtractionPoint anyActiveExtractionPoint = GetAnyActiveExtractionPoint(); if ((Object)(object)anyActiveExtractionPoint != (Object)null) { val2 = GetExtractionPointButtonPosition(anyActiveExtractionPoint); if (val2 != Vector3.zero) { flag = true; } } } if (flag) { try { TeleportPlayer(val, val2); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[TeleportPlayersWithDelayCoroutine Error]: {arg}"); } } } } if (i < targetAvatars.Count - 1) { yield return (object)new WaitForSeconds(0.3f); } } } private static void TeleportPlayer(PlayerAvatar avatar, Vector3 position) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)avatar == (Object)null) && (Object)(object)Instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayerWithRetryCoroutine(avatar, position)); } } private static IEnumerator TeleportPlayerWithRetryCoroutine(PlayerAvatar avatar, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null) { yield break; } Instance?.StartTeleportJob(); string steamID = null; try { steamID = PlayerAvatarSteamIDRef.Invoke(avatar); } catch { } bool wasAlreadyGod = false; if (!string.IsNullOrEmpty(steamID)) { wasAlreadyGod = IsPlayerGodMode(steamID) || IsPlayerTempGodMode(steamID); if (!wasAlreadyGod) { try { SetPlayerTempGodMode(steamID, enable: true); } catch { } } } try { for (int attempt = 1; attempt <= 5; attempt++) { ExecuteTeleportPlayerRaw(avatar, position); yield return (object)new WaitForFixedUpdate(); yield return null; if ((Object)(object)avatar == (Object)null) { break; } Vector3 val = Vector3.zero; try { val = GetPlayerPosition(avatar); } catch { } float num = Vector3.Distance(val, position); if (num < 1.5f) { break; } if (attempt < 5) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[GameTools] Player {((Object)avatar).name} teleport attempt {attempt} failed (dist: {num:F2}m). Retrying in 0.5s..."); } yield return (object)new WaitForSecondsRealtime(0.5f); } else { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogError((object)("[GameTools] Player " + ((Object)avatar).name + " teleport failed after 5 attempts.")); } } } } finally { Instance?.EndTeleportJob(); } yield return (object)new WaitForSecondsRealtime(10f); if (!string.IsNullOrEmpty(steamID) && !wasAlreadyGod) { try { SetPlayerTempGodMode(steamID, enable: false); } catch { } } } private static IEnumerator MonitorPlayerOutOfBoundsCoroutine(PlayerAvatar avatar, Vector3 intendedPos, float duration = 5f) { yield break; } private static IEnumerator PullAllEnemiesCoroutine(List enemies, Vector3 playerPos, Vector3 playerForward) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float interval = ((_cfgEnemyPullInterval != null) ? _cfgEnemyPullInterval.Value : 0.1f); float num = ((_cfgEnemyPullDistance != null) ? _cfgEnemyPullDistance.Value : 3f); Vector3 targetBasePos = playerPos + playerForward * num + Vector3.up * 0.5f; foreach (EnemyParent enemy in enemies) { if (!((Object)(object)enemy != (Object)null) || !EnemyParentSpawnedRef.Invoke(enemy)) { continue; } Enemy val = EnemyParentEnemyRef.Invoke(enemy); if ((Object)(object)val != (Object)null) { try { Vector3 val2 = Random.insideUnitSphere * 0.5f; val2.y = 0f; Vector3 position = targetBasePos + val2; TeleportEnemy(val, position); } catch { } yield return (object)new WaitForSeconds(interval); } } } public static Vector3 FixEnemyPositionIfWall(Enemy enemy, Vector3 targetPos, float defaultRadius = 0.6f) { //IL_0098: 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_004b: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) float num = defaultRadius; if ((Object)(object)enemy != (Object)null) { try { Collider componentInChildren = ((Component)enemy).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { float num2 = 0f; CapsuleCollider val = (CapsuleCollider)(object)((componentInChildren is CapsuleCollider) ? componentInChildren : null); if (val != null) { num2 = val.radius; } else { SphereCollider val2 = (SphereCollider)(object)((componentInChildren is SphereCollider) ? componentInChildren : null); if (val2 != null) { num2 = val2.radius; } else { Bounds bounds = componentInChildren.bounds; float x = ((Bounds)(ref bounds)).extents.x; bounds = componentInChildren.bounds; num2 = Mathf.Max(x, ((Bounds)(ref bounds)).extents.z); } } if (num2 > 0.1f) { num = num2; } } } catch { } } num = Mathf.Clamp(num, 0.3f, 1.5f); return FixPositionIfWall(targetPos, num); } private static IEnumerator MonitorEnemyOutOfBoundsCoroutine(Enemy enemy, Vector3 safePosition, float duration = 10f) { yield break; } private static void TeleportEnemy(Enemy enemy, Vector3 position) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)enemy == (Object)null) && (Object)(object)Instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(TeleportEnemyWithRetryCoroutine(enemy, position)); } } private static IEnumerator TeleportEnemyWithRetryCoroutine(Enemy enemy, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)enemy == (Object)null) { yield break; } position = GetSafeFloorPosition(position); for (int attempt = 1; attempt <= 5; attempt++) { try { enemy.EnemyTeleported(position); } catch (Exception arg) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"[EnemyTeleport Error] {((Object)enemy).name} attempt {attempt}: {arg}"); } } if (SemiFunc.IsMultiplayer() && !PhotonNetwork.IsMasterClient) { break; } yield return (object)new WaitForFixedUpdate(); yield return null; if ((Object)(object)enemy == (Object)null) { break; } float num = Vector3.Distance(((Component)enemy).transform.position, position); if (num < 1.5f) { break; } if (attempt < 5) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[GameTools] Enemy {((Object)enemy).name} teleport attempt {attempt} failed (dist: {num:F2}m). Retrying in 0.5s..."); } yield return (object)new WaitForSecondsRealtime(0.5f); } else { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogError((object)("[GameTools] Enemy " + ((Object)enemy).name + " teleport failed after 5 attempts.")); } } } } private static void ExecuteTeleportPlayerRaw(PlayerAvatar avatar, Vector3 position) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0245: 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_00fd: 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_009a: 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_038e: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Expected O, but got Unknown //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)avatar == (Object)null) { return; } if (!PhotonNetwork.InRoom) { if (PlayerAvatarDeadSetRef.Invoke(avatar)) { PlayerDeathHead val = PlayerAvatarPlayerDeathHeadRef.Invoke(avatar); if ((Object)(object)val != (Object)null) { PhysGrabObject val2 = PlayerDeathHeadPhysGrabObjectRef.Invoke(val); if ((Object)(object)val2 != (Object)null) { val2.Teleport(position, Quaternion.identity); } } return; } PlayerTumble val3 = PlayerAvatarTumbleRef.Invoke(avatar); if ((Object)(object)val3 != (Object)null) { PhysGrabObject val4 = PlayerTumblePhysGrabObjectRef.Invoke(val3); if ((Object)(object)val4 != (Object)null) { val4.Teleport(position, Quaternion.identity); if ((Object)(object)val4.rb != (Object)null) { val4.rb.velocity = Vector3.zero; val4.rb.angularVelocity = Vector3.zero; } } } ((Component)avatar).transform.position = position; Rigidbody component = ((Component)avatar).GetComponent(); if ((Object)(object)component != (Object)null) { component.velocity = Vector3.zero; component.angularVelocity = Vector3.zero; } if ((Object)(object)PlayerController.instance != (Object)null && PlayerAvatarIsLocalRef.Invoke(avatar)) { ((Component)PlayerController.instance).transform.position = position; Rigidbody component2 = ((Component)PlayerController.instance).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.velocity = Vector3.zero; component2.angularVelocity = Vector3.zero; } } return; } if (PlayerAvatarIsLocalRef.Invoke(avatar)) { if (PlayerAvatarDeadSetRef.Invoke(avatar)) { PlayerDeathHead val5 = PlayerAvatarPlayerDeathHeadRef.Invoke(avatar); if ((Object)(object)val5 != (Object)null) { PhysGrabObject val6 = PlayerDeathHeadPhysGrabObjectRef.Invoke(val5); if ((Object)(object)val6 != (Object)null) { val6.Teleport(position, Quaternion.identity); } } } else { PlayerTumble val7 = PlayerAvatarTumbleRef.Invoke(avatar); if ((Object)(object)val7 != (Object)null) { PhysGrabObject val8 = PlayerTumblePhysGrabObjectRef.Invoke(val7); if ((Object)(object)val8 != (Object)null) { val8.Teleport(position, Quaternion.identity); if ((Object)(object)val8.rb != (Object)null) { val8.rb.velocity = Vector3.zero; val8.rb.angularVelocity = Vector3.zero; } } } } ((Component)avatar).transform.position = position; Rigidbody component3 = ((Component)avatar).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.velocity = Vector3.zero; component3.angularVelocity = Vector3.zero; } if ((Object)(object)PlayerController.instance != (Object)null) { ((Component)PlayerController.instance).transform.position = position; Rigidbody component4 = ((Component)PlayerController.instance).GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.velocity = Vector3.zero; component4.angularVelocity = Vector3.zero; } } if (PhotonNetwork.IsMasterClient && (Object)(object)avatar.photonView != (Object)null) { avatar.photonView.RPC("SpawnRPC", (RpcTarget)0, new object[2] { position, ((Component)avatar).transform.rotation }); } return; } if (PhotonNetwork.IsMasterClient && (Object)(object)avatar.photonView != (Object)null) { if (PlayerAvatarDeadSetRef.Invoke(avatar)) { PlayerDeathHead val9 = PlayerAvatarPlayerDeathHeadRef.Invoke(avatar); if ((Object)(object)val9 != (Object)null) { PhysGrabObject val10 = PlayerDeathHeadPhysGrabObjectRef.Invoke(val9); if ((Object)(object)val10 != (Object)null) { val10.Teleport(position, Quaternion.identity); } } } avatar.photonView.RPC("SpawnRPC", (RpcTarget)0, new object[2] { position, ((Component)avatar).transform.rotation }); return; } bool flag = false; if ((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null && ((Dictionary)(object)avatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value) { flag = true; } if (flag && (Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) { string text = avatar.photonView.Owner.ActorNumber.ToString(); string text2 = PlayerAvatarSteamIDRef.Invoke(avatar); Hashtable val11 = new Hashtable(); float[] array = new float[3] { position.x, position.y, position.z }; val11[(object)("GT_ReqTeleport_" + text)] = array; if (!string.IsNullOrEmpty(text2)) { val11[(object)("GT_ReqTeleport_" + text2)] = array; } PhotonNetwork.LocalPlayer.SetCustomProperties(val11, (Hashtable)null, (WebFlags)null); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)$"[GameTools] Request teleport (via properties) for remote player: {((Object)avatar).name} to {position}"); } } } catch (Exception arg) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)$"[TeleportPlayer Error] {((Object)avatar).name}: {arg}"); } } } private void RevivePlayer(PlayerAvatar avatar) { //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown try { if ((Object)(object)avatar == (Object)null) { return; } if (!PhotonNetwork.InRoom) { avatar.Revive(false); return; } if (PlayerAvatarIsLocalRef.Invoke(avatar)) { avatar.Revive(false); return; } if (PhotonNetwork.IsMasterClient && (Object)(object)avatar.photonView != (Object)null) { avatar.photonView.RPC("ReviveRPC", (RpcTarget)0, new object[1] { false }); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] Host directly sent ReviveRPC for player: " + ((Object)avatar).name)); } } string text = PlayerAvatarSteamIDRef.Invoke(avatar); string text2 = (((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) ? avatar.photonView.Owner.ActorNumber.ToString() : ""); bool flag = false; if ((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null && ((Dictionary)(object)avatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value) { flag = true; } if (flag && !string.IsNullOrEmpty(text2)) { Hashtable val = new Hashtable(); val[(object)("GT_ReqRevive_" + text2)] = true; if (!string.IsNullOrEmpty(text)) { val[(object)("GT_ReqRevive_" + text)] = true; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)("[GameTools] Sent secondary Revive request via properties for modded player: " + ((Object)avatar).name)); } } } catch (Exception arg) { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogWarning((object)$"[RevivePlayer Error] {((Object)avatar).name}: {arg}"); } } } private void KillPlayer(PlayerAvatar avatar) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown try { if ((Object)(object)avatar == (Object)null) { return; } if (!PhotonNetwork.InRoom) { avatar.PlayerDeath(-1); return; } if (PlayerAvatarIsLocalRef.Invoke(avatar)) { avatar.PlayerDeath(-1); return; } string text = PlayerAvatarSteamIDRef.Invoke(avatar); string text2 = (((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) ? avatar.photonView.Owner.ActorNumber.ToString() : ""); bool flag = false; if ((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null && ((Dictionary)(object)avatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value) { flag = true; } if (flag && !string.IsNullOrEmpty(text2)) { Hashtable val = new Hashtable(); val[(object)("GT_ReqKill_" + text2)] = true; if (!string.IsNullOrEmpty(text)) { val[(object)("GT_ReqKill_" + text)] = true; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] Request kill (via properties) for modded player: " + ((Object)avatar).name)); } } else if (PhotonNetwork.IsMasterClient && (Object)(object)avatar.photonView != (Object)null) { avatar.photonView.RPC("PlayerDeathRPC", (RpcTarget)0, new object[1] { -1 }); Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)("[GameTools] Host directly sent PlayerDeathRPC for vanilla player: " + ((Object)avatar).name)); } } } catch (Exception arg) { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogWarning((object)$"[KillPlayer Error] {((Object)avatar).name}: {arg}"); } } } private void HealPlayer(PlayerAvatar avatar) { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown try { if ((Object)(object)avatar == (Object)null) { return; } if (!PhotonNetwork.InRoom) { if ((Object)(object)avatar.playerHealth != (Object)null) { int num = PlayerHealthMaxRef.Invoke(avatar.playerHealth); avatar.playerHealth.Heal(num, true); } return; } if (PlayerAvatarIsLocalRef.Invoke(avatar) && (Object)(object)avatar.playerHealth != (Object)null) { int num2 = PlayerHealthMaxRef.Invoke(avatar.playerHealth); avatar.playerHealth.Heal(num2, true); return; } string text = PlayerAvatarSteamIDRef.Invoke(avatar); string text2 = (((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) ? avatar.photonView.Owner.ActorNumber.ToString() : ""); bool flag = false; if ((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null && ((Dictionary)(object)avatar.photonView.Owner.CustomProperties).TryGetValue((object)"GT_Active", out object value) && value is bool && (bool)value) { flag = true; } if (flag && !string.IsNullOrEmpty(text2)) { Hashtable val = new Hashtable(); val[(object)("GT_ReqHeal_" + text2)] = true; if (!string.IsNullOrEmpty(text)) { val[(object)("GT_ReqHeal_" + text)] = true; } PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("[GameTools] Request heal (via properties) for modded player: " + ((Object)avatar).name)); } } else if (PhotonNetwork.IsMasterClient && (Object)(object)avatar.photonView != (Object)null && (Object)(object)avatar.playerHealth != (Object)null) { int num3 = PlayerHealthMaxRef.Invoke(avatar.playerHealth); avatar.photonView.RPC("UpdateHealthRPC", (RpcTarget)0, new object[4] { num3, num3, true, false }); Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)("[GameTools] Host directly sent UpdateHealthRPC for vanilla player: " + ((Object)avatar).name)); } } } catch (Exception arg) { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogWarning((object)$"[HealPlayer Error] {((Object)avatar).name}: {arg}"); } } } private void DrawHostProhibitedBanner(float curX, ref float curY, float curW) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) string text = (UseChinese() ? "⚠\ufe0f 房主已禁用当前模块功能 (Host Prohibited)" : "⚠\ufe0f This module has been disabled by the Host"); Rect val = default(Rect); ((Rect)(ref val))..ctor(curX, curY, curW, 36f); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); GUI.Label(val, "" + text + "", _sCenteredLabel); curY += 46f; } private void DrawTabCosmetics(float curX, ref float curY, float curW, float innerX, float innerW) { //IL_0010: 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_00ba: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0a58: Unknown result type (might be due to invalid IL or missing references) //IL_0aed: Unknown result type (might be due to invalid IL or missing references) //IL_0b60: Unknown result type (might be due to invalid IL or missing references) //IL_0b98: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_0cd0: Unknown result type (might be due to invalid IL or missing references) //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_0de4: Unknown result type (might be due to invalid IL or missing references) //IL_0eb0: Unknown result type (might be due to invalid IL or missing references) //IL_0f01: Unknown result type (might be due to invalid IL or missing references) //IL_0f58: Unknown result type (might be due to invalid IL or missing references) //IL_0faf: Unknown result type (might be due to invalid IL or missing references) //IL_1065: Unknown result type (might be due to invalid IL or missing references) //IL_10b6: Unknown result type (might be due to invalid IL or missing references) //IL_110d: Unknown result type (might be due to invalid IL or missing references) //IL_1164: Unknown result type (might be due to invalid IL or missing references) //IL_121a: Unknown result type (might be due to invalid IL or missing references) //IL_126d: Unknown result type (might be due to invalid IL or missing references) //IL_12c6: Unknown result type (might be due to invalid IL or missing references) //IL_131f: Unknown result type (might be due to invalid IL or missing references) //IL_13c2: Unknown result type (might be due to invalid IL or missing references) //IL_1415: Unknown result type (might be due to invalid IL or missing references) //IL_146e: Unknown result type (might be due to invalid IL or missing references) //IL_14df: Unknown result type (might be due to invalid IL or missing references) //IL_154b: Unknown result type (might be due to invalid IL or missing references) //IL_15e4: Unknown result type (might be due to invalid IL or missing references) //IL_1650: Unknown result type (might be due to invalid IL or missing references) //IL_16d2: Unknown result type (might be due to invalid IL or missing references) //IL_1716: Unknown result type (might be due to invalid IL or missing references) //IL_1729: Unknown result type (might be due to invalid IL or missing references) //IL_174b: Unknown result type (might be due to invalid IL or missing references) //IL_1784: Unknown result type (might be due to invalid IL or missing references) //IL_1887: Unknown result type (might be due to invalid IL or missing references) //IL_17f1: Unknown result type (might be due to invalid IL or missing references) //IL_17f8: Expected O, but got Unknown //IL_18ee: Unknown result type (might be due to invalid IL or missing references) //IL_18f5: Expected O, but got Unknown //IL_196b: Unknown result type (might be due to invalid IL or missing references) //IL_19cd: Unknown result type (might be due to invalid IL or missing references) //IL_1a81: Unknown result type (might be due to invalid IL or missing references) //IL_1a3d: Unknown result type (might be due to invalid IL or missing references) //IL_1a44: Expected O, but got Unknown //IL_1aed: Unknown result type (might be due to invalid IL or missing references) //IL_1af4: Expected O, but got Unknown //IL_1b80: Unknown result type (might be due to invalid IL or missing references) //IL_1c3a: Unknown result type (might be due to invalid IL or missing references) //IL_1be7: Unknown result type (might be due to invalid IL or missing references) //IL_1bee: Expected O, but got Unknown //IL_1cf5: Unknown result type (might be due to invalid IL or missing references) //IL_1ca1: Unknown result type (might be due to invalid IL or missing references) //IL_1ca8: Expected O, but got Unknown //IL_1daf: Unknown result type (might be due to invalid IL or missing references) //IL_1d5c: Unknown result type (might be due to invalid IL or missing references) //IL_1d63: Expected O, but got Unknown //IL_1e6a: Unknown result type (might be due to invalid IL or missing references) //IL_1e16: Unknown result type (might be due to invalid IL or missing references) //IL_1e1d: Expected O, but got Unknown //IL_1ed1: Unknown result type (might be due to invalid IL or missing references) //IL_1ed8: Expected O, but got Unknown //IL_2002: Unknown result type (might be due to invalid IL or missing references) //IL_2088: Unknown result type (might be due to invalid IL or missing references) //IL_20d1: Unknown result type (might be due to invalid IL or missing references) //IL_20e4: Unknown result type (might be due to invalid IL or missing references) //IL_2106: Unknown result type (might be due to invalid IL or missing references) //IL_213f: Unknown result type (might be due to invalid IL or missing references) //IL_21a6: Unknown result type (might be due to invalid IL or missing references) //IL_21ad: Expected O, but got Unknown //IL_232d: Unknown result type (might be due to invalid IL or missing references) //IL_2376: Unknown result type (might be due to invalid IL or missing references) //IL_237d: Expected O, but got Unknown bool enabled = GUI.enabled; bool flag = DrawStyledToggle(new Rect(curX, curY, curW, 36f), _cfgCosmeticsEnabled.Value, UseChinese() ? "\ud83d\udfe2 启用个人装扮与视觉表现功能" : "\ud83d\udfe2 Enable Cosmetics & Visuals"); if (flag != _cfgCosmeticsEnabled.Value) { _cfgCosmeticsEnabled.Value = flag; SaveRuntimeConfig(); } curY += 48f; if (!flag) { GUI.enabled = false; } string text = (UseChinese() ? "\ud83d\udd04 重置全部装扮与表现" : "\ud83d\udd04 Reset Cosmetics & Visuals"); if (GUI.Button(new Rect(curX, curY, curW, 40f), text, _sBtnRed)) { ResetVisualSettings(); } curY += 52f; float num = 230f; Rect val = default(Rect); ((Rect)(ref val))..ctor(curX, curY, curW, num); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); float num2 = curY + 12f; GUI.Label(new Rect(innerX, num2, innerW, 24f), UseChinese() ? "\ud83c\udfa5 第三人称视角" : "\ud83c\udfa5 Third-Person View", _sTitle); num2 += 32f; bool flag2 = DrawStyledToggle(new Rect(innerX, num2, innerW, 34f), _cfgThirdPersonEnabled.Value, UseChinese() ? "\ud83c\udfa5 开启第三人称视角 [快捷键: H] (俯瞰视角显示本地玩家)" : "3rd Person View [Hotkey: H] (Overlook local player)"); if (flag2 != _cfgThirdPersonEnabled.Value) { _cfgThirdPersonEnabled.Value = flag2; SaveRuntimeConfig(); } num2 += 34f; bool enabled2 = GUI.enabled; GUI.enabled = enabled2 && _cfgThirdPersonEnabled.Value; GUI.Label(new Rect(innerX, num2, 280f, 24f), UseChinese() ? ("机位距离: " + _cfgThirdPersonDistance.Value.ToString("F1")) : ("Camera Distance: " + _cfgThirdPersonDistance.Value.ToString("F1")), _sLabel); float num3 = GUI.HorizontalSlider(new Rect(innerX + 290f, num2 + 6f, innerW - 290f, 20f), _cfgThirdPersonDistance.Value, 1f, 5f, _sSlider, _sThumb); if (Mathf.Abs(num3 - _cfgThirdPersonDistance.Value) > 0.01f) { _cfgThirdPersonDistance.Value = num3; SaveRuntimeConfig(); } num2 += 28f; GUI.Label(new Rect(innerX, num2, 280f, 24f), UseChinese() ? ("机位高度: " + _cfgThirdPersonHeight.Value.ToString("F1")) : ("Camera Height: " + _cfgThirdPersonHeight.Value.ToString("F1")), _sLabel); float num4 = GUI.HorizontalSlider(new Rect(innerX + 290f, num2 + 6f, innerW - 290f, 20f), _cfgThirdPersonHeight.Value, 0f, 2f, _sSlider, _sThumb); if (Mathf.Abs(num4 - _cfgThirdPersonHeight.Value) > 0.01f) { _cfgThirdPersonHeight.Value = num4; SaveRuntimeConfig(); } num2 += 28f; GUI.Label(new Rect(innerX, num2, 280f, 24f), UseChinese() ? ("人物缩放: " + _cfgThirdPersonModelScale.Value.ToString("F2") + "x") : ("Model Scale: " + _cfgThirdPersonModelScale.Value.ToString("F2") + "x"), _sLabel); float num5 = GUI.HorizontalSlider(new Rect(innerX + 290f, num2 + 6f, innerW - 290f, 20f), _cfgThirdPersonModelScale.Value, 0.2f, 1f, _sSlider, _sThumb); if (Mathf.Abs(num5 - _cfgThirdPersonModelScale.Value) > 0.01f) { _cfgThirdPersonModelScale.Value = num5; SaveRuntimeConfig(); } num2 += 28f; GUI.Label(new Rect(innerX, num2, 280f, 24f), UseChinese() ? ("相机左右偏置 (左右): " + ((_cfgThirdPersonHorizontal.Value > 0.01f) ? "+" : "") + _cfgThirdPersonHorizontal.Value.ToString("F2") + "米") : ("Camera Horizontal (Left/Right): " + ((_cfgThirdPersonHorizontal.Value > 0.01f) ? "+" : "") + _cfgThirdPersonHorizontal.Value.ToString("F2") + "m"), _sLabel); float num6 = GUI.HorizontalSlider(new Rect(innerX + 290f, num2 + 6f, innerW - 290f, 20f), _cfgThirdPersonHorizontal.Value, -1.5f, 1.5f, _sSlider, _sThumb); if (Mathf.Abs(num6 - _cfgThirdPersonHorizontal.Value) > 0.01f) { _cfgThirdPersonHorizontal.Value = num6; SaveRuntimeConfig(); } num2 += 34f; GUI.enabled = enabled2; GUI.Label(new Rect(innerX, num2, innerW, 24f), UseChinese() ? "※ 第三人称不受房主禁用限制,支持玩家在任何模式下自由查看自己的装扮与表现。" : "* Third-Person is not restricted by host and lets you see your cosmetics in any mode.", _sStatus); curY += num + 20f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(curX, curY, curW, 336f); GUI.Box(val2, "", _sSection); DrawBorderRect(val2, _texBorder); float num7 = curY + 12f; bool flag3 = DrawStyledToggle(new Rect(innerX, num7, innerW, 34f), _cfgWingsAlwaysShow.Value, UseChinese() ? "激活翅膀常显 (不论是否情绪跌落、是否落地,炫酷发光翅膀永久展开)" : "Wings Always Active (Glowing wings stay active indefinitely)"); if (flag3 != _cfgWingsAlwaysShow.Value) { _cfgWingsAlwaysShow.Value = flag3; SaveRuntimeConfig(); } num7 += 40f; bool enabled3 = GUI.enabled; GUI.enabled = enabled3 && flag3; int wingsColorIndex = GetWingsColorIndex(); int num8 = DrawStyledSliderInt(label: (wingsColorIndex == 3) ? (UseChinese() ? ("交替频率: " + ((_cfgWingsShowFrequency.Value == 0) ? "极速 (0.2秒)" : $"每隔 {_cfgWingsShowFrequency.Value} 秒切换颜色")) : ("Swap Interval: " + ((_cfgWingsShowFrequency.Value == 0) ? "Fast (0.2s)" : $"{_cfgWingsShowFrequency.Value}s"))) : (UseChinese() ? ("显示频率: " + ((_cfgWingsShowFrequency.Value == 0) ? "常亮 (0秒)" : $"每隔 {_cfgWingsShowFrequency.Value} 秒显示一次")) : ("Flicker Interval: " + ((_cfgWingsShowFrequency.Value == 0) ? "Always ON" : $"{_cfgWingsShowFrequency.Value}s"))), rect: new Rect(innerX, num7, innerW, 36f), value: _cfgWingsShowFrequency.Value, min: 0, max: 5); if (num8 != _cfgWingsShowFrequency.Value) { _cfgWingsShowFrequency.Value = num8; SaveRuntimeConfig(); } num7 += 42f; GUI.Label(new Rect(innerX, num7, 500f, 24f), UseChinese() ? "翅膀指定颜色 (所有联机玩家可见):" : "Wings Color (Visible to All):", _sLabel); num7 += 34f; string[] array = (UseChinese() ? new string[3] { "原版粉色 (2级)", "原版蓝色 (3级)", "红蓝交替闪烁" } : new string[3] { "Pink (Level 2)", "Blue (Level 3)", "Red/Blue Alternating" }); int[] array2 = new int[3] { 1, 2, 3 }; float num9 = (innerW - 20f) / 3f; float num10 = 36f; for (int i = 0; i < 3; i++) { bool flag4 = _cfgWingsColorIndex.Value == array2[i]; if (GUI.Button(new Rect(innerX + (float)i * (num9 + 10f), num7, num9, num10), array[i], flag4 ? _sBtnGreen : _sBtnNormal)) { _cfgWingsColorIndex.Value = array2[i]; SaveRuntimeConfig(); } } num7 += 42f; bool flag5 = DrawStyledToggle(new Rect(innerX, num7, innerW, 34f), _cfgEnableWingsSound.Value, UseChinese() ? "播放翅膀背景音乐 (常显状态下开启/关闭滑翔声效,默认关闭)" : "Play Wings Background Music (Toggle glide sound in active state, OFF by default)"); if (flag5 != _cfgEnableWingsSound.Value) { _cfgEnableWingsSound.Value = flag5; SaveRuntimeConfig(); } num7 += 40f; bool flag6 = DrawStyledToggle(new Rect(innerX, num7, innerW, 34f), _cfgTumbleFlyEnabled.Value, UseChinese() ? "Q键飞行方向控制 (空中摔倒状态下按 WASD + 空格/Ctrl 自由飞翔)" : "Tumble Fly Control (WASD + Space/Ctrl to fly freely in ragdoll state)"); if (flag6 != _cfgTumbleFlyEnabled.Value) { _cfgTumbleFlyEnabled.Value = flag6; SaveRuntimeConfig(); } num7 += 40f; GUI.Label(new Rect(innerX, num7, innerW, 24f), UseChinese() ? "※ 开启后,在空中摔倒时能自由控制飞行方向。飞行状态下会自动展开背部翅膀。" : "* Allows controlling ragdoll flight in mid-air. Wings will render automatically.", _sStatus); GUI.enabled = enabled3; curY += 376f; float num11 = 600f; Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(curX, curY, curW, num11); GUI.Box(val3, "", _sSection); DrawBorderRect(val3, _texBorder); float num12 = curY + 12f; GUI.Label(new Rect(innerX, num12, innerW, 24f), UseChinese() ? "\ud83c\udfad 模型外观" : "\ud83c\udfad Model Appearance", _sTitle); num12 += 32f; bool flag7 = DrawStyledToggle(new Rect(innerX, num12, innerW, 34f), _cfgFlipEnabled != null && _cfgFlipEnabled.Value, UseChinese() ? "开启倒立 (所有联机玩家看到你的模型上下颠倒)" : "Enable Upside-Down (Other players see your model flipped)"); if (_cfgFlipEnabled != null && flag7 != _cfgFlipEnabled.Value) { _cfgFlipEnabled.Value = flag7; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; bool enabled4 = GUI.enabled; GUI.enabled = enabled4 && _cfgFlipEnabled != null && _cfgFlipEnabled.Value; bool flag8 = DrawStyledToggle(new Rect(innerX, num12, innerW, 34f), _cfgFlipShowToSelf != null && _cfgFlipShowToSelf.Value, UseChinese() ? "自己也能看到倒立效果 (需开启第三人称视角)" : "Show Flip to Self (Requires third-person view)"); if (_cfgFlipShowToSelf != null && flag8 != _cfgFlipShowToSelf.Value) { _cfgFlipShowToSelf.Value = flag8; SaveRuntimeConfig(); } num12 += 40f; GUI.enabled = enabled4; GUI.Label(new Rect(innerX, num12, innerW, 24f), UseChinese() ? "※ 倒立通过修改网络同步旋转实现,仅为视觉效果,不影响移动操作。" : "* Flip is a cosmetic effect via network rotation sync. Does not affect movement.", _sStatus); num12 += 28f; GUI.Label(new Rect(innerX, num12, innerW, 24f), UseChinese() ? "\ud83d\udd04 模型自动旋转" : "\ud83d\udd04 Auto Spin", _sLabel); num12 += 26f; bool flag9 = DrawStyledToggle(new Rect(innerX, num12, innerW, 34f), _cfgSpinEnabled != null && _cfgSpinEnabled.Value, UseChinese() ? "开启模型旋转 (开启后模型在原地自动打转)" : "Enable Model Spin (Model auto rotates in place)"); if (_cfgSpinEnabled != null && flag9 != _cfgSpinEnabled.Value) { _cfgSpinEnabled.Value = flag9; if (!flag9) { _spinAngle = 0f; } SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; bool enabled5 = GUI.enabled; GUI.enabled = enabled5 && flag9; bool flag10 = DrawStyledToggle(new Rect(innerX, num12, innerW, 34f), _cfgSpinShowToSelf != null && _cfgSpinShowToSelf.Value, UseChinese() ? "自己也能看到旋转效果 (需开启第三人称视角)" : "Show Spin to Self (Requires third-person view)"); if (_cfgSpinShowToSelf != null && flag10 != _cfgSpinShowToSelf.Value) { _cfgSpinShowToSelf.Value = flag10; SaveRuntimeConfig(); } num12 += 40f; bool flag11 = DrawStyledToggle(new Rect(innerX, num12, innerW, 34f), _cfgSpinFreeze != null && _cfgSpinFreeze.Value, UseChinese() ? "定格当前旋转位置" : "Freeze Current Spin Position"); if (_cfgSpinFreeze != null && flag11 != _cfgSpinFreeze.Value) { _cfgSpinFreeze.Value = flag11; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; int num13 = ((_cfgSpinDirection == null) ? 1 : _cfgSpinDirection.Value); float num14 = (innerW - 4f) / 2f; string text2 = (UseChinese() ? "⟳ 顺时针" : "⟳ Clockwise"); string text3 = (UseChinese() ? "⟲ 逆时针" : "⟲ Counter-Clockwise"); if (GUI.Button(new Rect(innerX, num12, num14, 34f), text2, (num13 == 1) ? _sBtnGreen : _sBtnNormal) && _cfgSpinDirection != null) { _cfgSpinDirection.Value = 1; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + num14 + 4f, num12, num14, 34f), text3, (num13 == 2) ? _sBtnGreen : _sBtnNormal) && _cfgSpinDirection != null) { _cfgSpinDirection.Value = 2; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; int num15 = ((_cfgSpinAxis == null) ? 1 : _cfgSpinAxis.Value); float num16 = (innerW - 12f) / 4f; string text4 = (UseChinese() ? "中心自转" : "Center Spin"); string text5 = (UseChinese() ? "前后翻滚" : "Front/Back"); string text6 = (UseChinese() ? "左右侧翻" : "Left/Right"); string text7 = (UseChinese() ? "洗衣机转" : "Washing"); if (GUI.Button(new Rect(innerX, num12, num16, 34f), text4, (num15 == 1) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 1; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + num16 + 4f, num12, num16, 34f), text5, (num15 == 2) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 2; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 2f * (num16 + 4f), num12, num16, 34f), text6, (num15 == 3) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 3; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 3f * (num16 + 4f), num12, num16, 34f), text7, (num15 == 4) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 4; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; float num17 = (innerW - 12f) / 4f; string text8 = (UseChinese() ? "螺旋波浪" : "Helical Wave"); string text9 = (UseChinese() ? "失控陀螺" : "Wobbly Gyro"); string text10 = (UseChinese() ? "倾斜漂移" : "Leaning Drift"); string text11 = (UseChinese() ? "过山车转" : "Coaster"); if (GUI.Button(new Rect(innerX, num12, num17, 34f), text8, (num15 == 5) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 5; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + num17 + 4f, num12, num17, 34f), text9, (num15 == 6) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 6; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 2f * (num17 + 4f), num12, num17, 34f), text10, (num15 == 7) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 7; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 3f * (num17 + 4f), num12, num17, 34f), text11, (num15 == 8) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 8; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; float num18 = (innerW - 12f) / 4f; string text12 = (UseChinese() ? "双螺旋线" : "DNA Helix"); string text13 = (UseChinese() ? "钟摆翘板" : "Seesaw"); string text14 = (UseChinese() ? "垂直回环" : "Vert Loop"); string text15 = (UseChinese() ? "醉酒摇摆" : "Drunk Sway"); if (GUI.Button(new Rect(innerX, num12, num18, 34f), text12, (num15 == 9) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 9; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + num18 + 4f, num12, num18, 34f), text13, (num15 == 10) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 10; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 2f * (num18 + 4f), num12, num18, 34f), text14, (num15 == 11) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 11; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 3f * (num18 + 4f), num12, num18, 34f), text15, (num15 == 12) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 12; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; float num19 = (innerW - 8f) / 3f; string text16 = (UseChinese() ? "向前点头 (鞠躬)" : "Nod Forward"); string text17 = (UseChinese() ? "向后点头 (挺胸)" : "Nod Backward"); string text18 = (UseChinese() ? "水平躺转 (平转)" : "Horizontal Spin"); if (GUI.Button(new Rect(innerX, num12, num19, 34f), text16, (num15 == 13) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 13; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + num19 + 4f, num12, num19, 34f), text17, (num15 == 14) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 14; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } if (GUI.Button(new Rect(innerX + 2f * (num19 + 4f), num12, num19, 34f), text18, (num15 == 15) ? _sBtnGreen : _sBtnNormal) && _cfgSpinAxis != null) { _cfgSpinAxis.Value = 15; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 40f; float num20 = ((_cfgSpinSpeed != null) ? _cfgSpinSpeed.Value : 0.3f); GUI.Label(new Rect(innerX, num12, 280f, 24f), UseChinese() ? ("旋转速度: " + num20.ToString("F1") + " 圈/秒") : ("Spin Speed: " + num20.ToString("F1") + " r/s"), _sLabel); float num21 = GUI.HorizontalSlider(new Rect(innerX + 290f, num12 + 6f, innerW - 290f, 20f), num20, 0.1f, 3f, _sSlider, _sThumb); num21 = Mathf.Round(num21 * 10f) / 10f; if (Mathf.Abs(num21 - num20) > 0.01f && _cfgSpinSpeed != null) { _cfgSpinSpeed.Value = num21; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 28f; float num22 = ((_cfgSpinRadius != null) ? _cfgSpinRadius.Value : 0f); GUI.Label(new Rect(innerX, num12, 280f, 24f), UseChinese() ? ("旋转中心偏置距离: " + num22.ToString("F1") + " 米") : ("Orbit Radius: " + num22.ToString("F1") + " m"), _sLabel); float num23 = GUI.HorizontalSlider(new Rect(innerX + 290f, num12 + 6f, innerW - 290f, 20f), num22, 0f, 5f, _sSlider, _sThumb); num23 = Mathf.Round(num23 * 10f) / 10f; if (Mathf.Abs(num23 - num22) > 0.05f && _cfgSpinRadius != null) { _cfgSpinRadius.Value = num23; SaveRuntimeConfig(); SyncSpinConfigsToNetwork(); } num12 += 28f; GUI.enabled = enabled5; GUI.Label(new Rect(innerX, num12, innerW, 24f), UseChinese() ? "※ 旋转与公转偏置对所有队友及自己可见(需第三人称且开启自己可见)。" : "* Spin and orbit radius sync to teammates and yourself (requires third-person and show self).", _sStatus); curY += num11 + 20f; float num24 = 420f; Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(curX, curY, curW, num24); GUI.Box(val4, "", _sSection); DrawBorderRect(val4, _texBorder); float num25 = curY + 12f; GUI.Label(new Rect(innerX, num25, innerW, 24f), UseChinese() ? "\ud83d\udc40 眼睛特效" : "\ud83d\udc40 Eye Effects", _sTitle); num25 += 32f; bool flag12 = DrawStyledToggle(new Rect(innerX, num25, innerW, 34f), _cfgEyeBigPupil != null && _cfgEyeBigPupil.Value, UseChinese() ? "开启大眼特效(大瞳孔)" : "Enable Big Pupils"); if (_cfgEyeBigPupil != null && flag12 != _cfgEyeBigPupil.Value) { _cfgEyeBigPupil.Value = flag12; SaveRuntimeConfig(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val5 = new Hashtable(); val5[(object)"GT_EyeBigPupil"] = flag12; val5[(object)"GT_EyeBigPupilAuto"] = _cfgEyePupilScaleAuto != null && _cfgEyePupilScaleAuto.Value; val5[(object)"GT_EyeBigPupilSpeed"] = ((_cfgEyePupilScaleSpeed != null) ? _cfgEyePupilScaleSpeed.Value : 1f); PhotonNetwork.LocalPlayer.SetCustomProperties(val5, (Hashtable)null, (WebFlags)null); } } num25 += 40f; GUI.enabled = enabled5 && flag12; bool flag13 = DrawStyledToggle(new Rect(innerX, num25, innerW, 34f), _cfgEyePupilScaleAuto != null && _cfgEyePupilScaleAuto.Value, UseChinese() ? " 开启瞳孔自动呼吸缩放" : " Enable Pupil Auto Breath Scale"); if (_cfgEyePupilScaleAuto != null && flag13 != _cfgEyePupilScaleAuto.Value) { _cfgEyePupilScaleAuto.Value = flag13; SaveRuntimeConfig(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val6 = new Hashtable(); val6[(object)"GT_EyeBigPupilAuto"] = flag13; PhotonNetwork.LocalPlayer.SetCustomProperties(val6, (Hashtable)null, (WebFlags)null); } } num25 += 40f; GUI.enabled = enabled5 && flag12 && _cfgEyePupilScaleAuto != null && _cfgEyePupilScaleAuto.Value; float num26 = ((_cfgEyePupilScaleSpeed != null) ? _cfgEyePupilScaleSpeed.Value : 0.3f); GUI.Label(new Rect(innerX, num25, 280f, 24f), UseChinese() ? (" 缩放速度: " + num26.ToString("F1")) : (" Scale Speed: " + num26.ToString("F1")), _sLabel); float num27 = GUI.HorizontalSlider(new Rect(innerX + 290f, num25 + 6f, innerW - 290f, 20f), num26, 0.1f, 5f, _sSlider, _sThumb); num27 = Mathf.Round(num27 * 10f) / 10f; if (_cfgEyePupilScaleSpeed != null && Mathf.Abs(num27 - num26) > 0.01f) { _cfgEyePupilScaleSpeed.Value = num27; SaveRuntimeConfig(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val7 = new Hashtable(); val7[(object)"GT_EyeBigPupilSpeed"] = num27; PhotonNetwork.LocalPlayer.SetCustomProperties(val7, (Hashtable)null, (WebFlags)null); } } GUI.enabled = enabled5; num25 += 40f; bool flag14 = DrawStyledToggle(new Rect(innerX, num25, innerW, 34f), _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value, UseChinese() ? "开启眼睛颜色特效" : "Enable Eye Color Effects"); if (_cfgEyeEffectEnabled != null && flag14 != _cfgEyeEffectEnabled.Value) { _cfgEyeEffectEnabled.Value = flag14; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val8 = new Hashtable(); val8[(object)"GT_EyeEffect"] = (flag14 ? CurrentEyeColor : 0); PhotonNetwork.LocalPlayer.SetCustomProperties(val8, (Hashtable)null, (WebFlags)null); } } num25 += 40f; bool enabled6 = GUI.enabled; GUI.enabled = enabled6 && _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value; float num28 = (innerW - 10f) / 2f; float num29 = 36f; bool flag15 = _cfgEyeMultiSelectRed != null && _cfgEyeMultiSelectRed.Value; if (GUI.Button(new Rect(innerX, num25, num28, num29), UseChinese() ? "红色眼睛" : "Red Eyes", flag15 ? _sBtnGreen : _sBtnNormal) && _cfgEyeMultiSelectRed != null) { _cfgEyeMultiSelectRed.Value = !_cfgEyeMultiSelectRed.Value; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val9 = new Hashtable(); val9[(object)"GT_EyeEffect"] = CurrentEyeColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val9, (Hashtable)null, (WebFlags)null); } } bool flag16 = _cfgEyeMultiSelectGreen != null && _cfgEyeMultiSelectGreen.Value; if (GUI.Button(new Rect(innerX + num28 + 10f, num25, num28, num29), UseChinese() ? "绿色眼睛" : "Green Eyes", flag16 ? _sBtnGreen : _sBtnNormal) && _cfgEyeMultiSelectGreen != null) { _cfgEyeMultiSelectGreen.Value = !_cfgEyeMultiSelectGreen.Value; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val10 = new Hashtable(); val10[(object)"GT_EyeEffect"] = CurrentEyeColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val10, (Hashtable)null, (WebFlags)null); } } num25 += 42f; bool flag17 = _cfgEyeMultiSelectLove != null && _cfgEyeMultiSelectLove.Value; if (GUI.Button(new Rect(innerX, num25, num28, num29), UseChinese() ? "粉色眼睛" : "Pink Eyes", flag17 ? _sBtnGreen : _sBtnNormal) && _cfgEyeMultiSelectLove != null) { _cfgEyeMultiSelectLove.Value = !_cfgEyeMultiSelectLove.Value; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val11 = new Hashtable(); val11[(object)"GT_EyeEffect"] = CurrentEyeColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val11, (Hashtable)null, (WebFlags)null); } } bool flag18 = _cfgEyeMultiSelectOrange != null && _cfgEyeMultiSelectOrange.Value; if (GUI.Button(new Rect(innerX + num28 + 10f, num25, num28, num29), UseChinese() ? "橙色眼睛" : "Orange Eyes", flag18 ? _sBtnGreen : _sBtnNormal) && _cfgEyeMultiSelectOrange != null) { _cfgEyeMultiSelectOrange.Value = !_cfgEyeMultiSelectOrange.Value; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val12 = new Hashtable(); val12[(object)"GT_EyeEffect"] = CurrentEyeColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val12, (Hashtable)null, (WebFlags)null); } } num25 += 42f; bool flag19 = _cfgEyeMultiSelectInverted != null && _cfgEyeMultiSelectInverted.Value; if (GUI.Button(new Rect(innerX, num25, innerW, num29), UseChinese() ? "黑白眼睛" : "Black & White Eyes", flag19 ? _sBtnGreen : _sBtnNormal) && _cfgEyeMultiSelectInverted != null) { _cfgEyeMultiSelectInverted.Value = !_cfgEyeMultiSelectInverted.Value; SaveRuntimeConfig(); UpdateLocalEyeTimer(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val13 = new Hashtable(); val13[(object)"GT_EyeEffect"] = CurrentEyeColor; PhotonNetwork.LocalPlayer.SetCustomProperties(val13, (Hashtable)null, (WebFlags)null); } } num25 += 42f; int num30 = 0; if (flag15) { num30++; } if (flag16) { num30++; } if (flag17) { num30++; } if (flag18) { num30++; } if (flag19) { num30++; } bool flag20 = _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value && num30 >= 2; GUI.enabled = enabled6 && flag20; float num31 = ((_cfgEyeSwapInterval != null) ? _cfgEyeSwapInterval.Value : 1f); float num32 = DrawStyledSliderFloat(label: UseChinese() ? ("切换间隔: " + ((Mathf.Abs(num31 - 1f) < 0.01f) ? "默认 (1秒)" : $"{num31:F1} 秒")) : ("Interval: " + ((Mathf.Abs(num31 - 1f) < 0.01f) ? "Default (1s)" : $"{num31:F1}s")), rect: new Rect(innerX, num25, innerW, 36f), value: num31, min: 0.1f, max: 5f); num32 = Mathf.Round(num32 * 10f) / 10f; if (_cfgEyeSwapInterval != null && num32 != _cfgEyeSwapInterval.Value) { _cfgEyeSwapInterval.Value = num32; SaveRuntimeConfig(); } num25 += 42f; GUI.enabled = enabled6 && _cfgEyeEffectEnabled != null && _cfgEyeEffectEnabled.Value; GUI.Label(new Rect(innerX, num25, innerW, 24f), UseChinese() ? "※ 勾选多种眼睛颜色时,在局内将以指定的时间间隔循环交替切换颜色闪烁。" : "* Select multiple eye colors to cycle/swap them dynamically in game.", _sStatus); GUI.enabled = enabled6; curY += num24 + 20f; float num33 = 210f; Rect val14 = default(Rect); ((Rect)(ref val14))..ctor(curX, curY, curW, num33); GUI.Box(val14, "", _sSection); DrawBorderRect(val14, _texBorder); float num34 = curY + 12f; GUI.Label(new Rect(innerX, num34, innerW, 24f), UseChinese() ? "\ud83d\udd26 手电筒自定义" : "\ud83d\udd26 Flashlight Customization", _sTitle); num34 += 28f; bool flag21 = DrawStyledToggle(new Rect(innerX, num34, innerW, 30f), _cfgFlashlightColorEnabled != null && _cfgFlashlightColorEnabled.Value, UseChinese() ? "启用自定义手电筒光源色彩 (向联机队友实时同步)" : "Enable Custom Flashlight Color (Sync to other players in real-time)"); if (_cfgFlashlightColorEnabled != null && flag21 != _cfgFlashlightColorEnabled.Value) { _cfgFlashlightColorEnabled.Value = flag21; SaveRuntimeConfig(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val15 = new Hashtable(); val15[(object)"GT_FlashlightColor"] = (flag21 ? ((_cfgFlashlightColor != null) ? _cfgFlashlightColor.Value : 0) : 0); PhotonNetwork.LocalPlayer.SetCustomProperties(val15, (Hashtable)null, (WebFlags)null); } } num34 += 34f; bool enabled7 = GUI.enabled; GUI.enabled = enabled7 && _cfgFlashlightColorEnabled != null && _cfgFlashlightColorEnabled.Value; float num35 = (innerW - 20f) / 3f; float num36 = 34f; string[] array3 = (UseChinese() ? new string[9] { "白色 (默认)", "红色", "绿色", "蓝色", "粉红色", "金色", "青色", "橙色", "霓虹彩虹" } : new string[9] { "White (Default)", "Red", "Green", "Blue", "Pink", "Gold", "Cyan", "Orange", "Rainbow" }); int num37 = array3.Length; for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { int num38 = j * 3 + k; if (num38 >= num37) { break; } bool flag22 = _cfgFlashlightColor != null && _cfgFlashlightColor.Value == num38; if (GUI.Button(new Rect(innerX + (float)k * (num35 + 10f), num34, num35, num36), array3[num38], flag22 ? _sBtnGreen : _sBtnNormal) && _cfgFlashlightColor != null) { _cfgFlashlightColor.Value = num38; SaveRuntimeConfig(); if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { Hashtable val16 = new Hashtable(); val16[(object)"GT_FlashlightColor"] = num38; PhotonNetwork.LocalPlayer.SetCustomProperties(val16, (Hashtable)null, (WebFlags)null); } } } num34 += 38f; } GUI.enabled = enabled7; curY += num33 + 20f; GUI.enabled = enabled; } private void DrawTabPlayerControl(float curX, ref float curY, float curW, float innerX, float innerW) { //IL_0f0c: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_13c1: Unknown result type (might be due to invalid IL or missing references) //IL_174e: Unknown result type (might be due to invalid IL or missing references) //IL_0f66: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0f36: Unknown result type (might be due to invalid IL or missing references) //IL_0f3b: Unknown result type (might be due to invalid IL or missing references) //IL_0f3d: Unknown result type (might be due to invalid IL or missing references) //IL_0f3f: Unknown result type (might be due to invalid IL or missing references) //IL_141e: Unknown result type (might be due to invalid IL or missing references) //IL_1431: Unknown result type (might be due to invalid IL or missing references) //IL_13fd: Unknown result type (might be due to invalid IL or missing references) //IL_140a: 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_0098: 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_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0d8c: Unknown result type (might be due to invalid IL or missing references) //IL_0d8e: Unknown result type (might be due to invalid IL or missing references) //IL_0d91: Invalid comparison between Unknown and I4 //IL_1450: Unknown result type (might be due to invalid IL or missing references) //IL_1455: Unknown result type (might be due to invalid IL or missing references) //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_0d96: Invalid comparison between Unknown and I4 //IL_0fd5: Unknown result type (might be due to invalid IL or missing references) //IL_0fe8: Unknown result type (might be due to invalid IL or missing references) //IL_100d: Unknown result type (might be due to invalid IL or missing references) //IL_1499: Unknown result type (might be due to invalid IL or missing references) //IL_14b6: Unknown result type (might be due to invalid IL or missing references) //IL_1475: Unknown result type (might be due to invalid IL or missing references) //IL_1786: Unknown result type (might be due to invalid IL or missing references) //IL_178b: Unknown result type (might be due to invalid IL or missing references) //IL_178d: Unknown result type (might be due to invalid IL or missing references) //IL_178f: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_179d: Unknown result type (might be due to invalid IL or missing references) //IL_104a: Unknown result type (might be due to invalid IL or missing references) //IL_14e6: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_153b: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_10cb: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_1128: Unknown result type (might be due to invalid IL or missing references) //IL_113b: Unknown result type (might be due to invalid IL or missing references) //IL_1107: Unknown result type (might be due to invalid IL or missing references) //IL_1114: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0e63: Unknown result type (might be due to invalid IL or missing references) //IL_0e82: Unknown result type (might be due to invalid IL or missing references) //IL_1162: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_1597: Unknown result type (might be due to invalid IL or missing references) //IL_0a69: Unknown result type (might be due to invalid IL or missing references) //IL_119d: Unknown result type (might be due to invalid IL or missing references) //IL_11fc: Unknown result type (might be due to invalid IL or missing references) //IL_121c: Unknown result type (might be due to invalid IL or missing references) //IL_1221: Unknown result type (might be due to invalid IL or missing references) //IL_1223: Unknown result type (might be due to invalid IL or missing references) //IL_1228: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_1608: Unknown result type (might be due to invalid IL or missing references) //IL_0ed8: Unknown result type (might be due to invalid IL or missing references) //IL_0edd: Unknown result type (might be due to invalid IL or missing references) //IL_0edf: Unknown result type (might be due to invalid IL or missing references) //IL_0ee1: Unknown result type (might be due to invalid IL or missing references) //IL_0eef: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b4a: Unknown result type (might be due to invalid IL or missing references) //IL_0b6c: Unknown result type (might be due to invalid IL or missing references) //IL_1644: Unknown result type (might be due to invalid IL or missing references) //IL_1649: Unknown result type (might be due to invalid IL or missing references) //IL_164d: Unknown result type (might be due to invalid IL or missing references) //IL_1698: Unknown result type (might be due to invalid IL or missing references) //IL_0c1d: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Unknown result type (might be due to invalid IL or missing references) //IL_0c29: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0d01: Unknown result type (might be due to invalid IL or missing references) //IL_16bf: Unknown result type (might be due to invalid IL or missing references) //IL_16c4: Unknown result type (might be due to invalid IL or missing references) //IL_16ce: Unknown result type (might be due to invalid IL or missing references) //IL_16d3: Unknown result type (might be due to invalid IL or missing references) //IL_16d8: Unknown result type (might be due to invalid IL or missing references) //IL_16fe: Unknown result type (might be due to invalid IL or missing references) List list = SemiFunc.PlayerGetList(); PlayerAvatar[] array = (PlayerAvatar[])((list != null) ? ((Array)list.ToArray()) : ((Array)new PlayerAvatar[0])); int num = array.Length; bool enabled = GUI.enabled; if (!IsStaticModEnabled()) { GUI.enabled = false; } string text = (UseChinese() ? "\ud83d\udd04 重置全部玩家选项" : "\ud83d\udd04 Reset All Player Settings"); if (GUI.Button(new Rect(curX, curY, curW, 40f), text, _sBtnRed)) { ResetPlayerSettings(); } curY += 52f; float num2 = 194f; Rect val = default(Rect); ((Rect)(ref val))..ctor(curX, curY, curW, num2); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); float num3 = curY + 12f; GUI.Label(new Rect(innerX, num3, innerW, 24f), UseChinese() ? "⚡ 一键全体操作" : "⚡ Batch Operations", _sTitle); num3 += 32f; float num4 = (innerW - 30f) / 4f; if (GUI.Button(new Rect(innerX, num3, num4, 40f), UseChinese() ? "\ud83d\udc9a 复活全部" : "\ud83d\udc9a Revive All", _sBtnGreen) && array != null) { PlayerAvatar[] array2 = array; foreach (PlayerAvatar val2 in array2) { try { if ((Object)(object)val2 != (Object)null && PlayerAvatarDeadSetRef.Invoke(val2)) { RevivePlayer(val2); } } catch { } } } string text2 = (UseChinese() ? "\ud83d\udc80 杀死全部" : "\ud83d\udc80 Kill All"); if (GUI.Button(new Rect(innerX + num4 + 10f, num3, num4, 40f), text2, _sBtnRed)) { _showConfirmKillAllTeammates = true; } bool num5 = (Object)(object)PlayerController.instance != (Object)null; bool enabled2 = GUI.enabled; if (!num5 || _isTeleporting) { GUI.enabled = false; } if (GUI.Button(new Rect(innerX + (num4 + 10f) * 2f, num3, num4, 40f), UseChinese() ? "\ud83e\uddf2 全体拉到面前" : "\ud83e\uddf2 Pull All to Front", _sBtnNormal) && array != null && (Object)(object)PlayerController.instance != (Object)null) { List list2 = new List(); PlayerAvatar[] array2 = array; foreach (PlayerAvatar val3 in array2) { if (!((Object)(object)val3 == (Object)null) && !PlayerAvatarIsLocalRef.Invoke(val3)) { list2.Add(val3); } } if (list2.Count > 0) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayersWithDelayCoroutine(list2, PlayerTeleportType.PullToFront)); } } GUI.enabled = enabled2; if (GUI.Button(new Rect(innerX + (num4 + 10f) * 3f, num3, num4, 40f), UseChinese() ? "❤\ufe0f 全体满血" : "❤\ufe0f Heal All", _sBtnNormal) && array != null) { PlayerAvatar[] array2 = array; foreach (PlayerAvatar val4 in array2) { try { if ((Object)(object)val4 != (Object)null) { HealPlayer(val4); } } catch { } } } num3 += 50f; GUI.enabled = enabled2 && array != null && array.Length != 0 && !_isTeleporting; if (GUI.Button(new Rect(innerX, num3, num4, 40f), UseChinese() ? "\ud83c\udfb2 全体随机分布" : "\ud83c\udfb2 Scatter All", _sBtnNormal) && array != null) { List list3 = new List(); PlayerAvatar[] array2 = array; foreach (PlayerAvatar val5 in array2) { if ((Object)(object)val5 != (Object)null) { list3.Add(val5); } } if (list3.Count > 0) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayersWithDelayCoroutine(list3, PlayerTeleportType.Scatter)); } } Vector3 truckPosition = GetTruckPosition(); bool flag = truckPosition != Vector3.zero; GUI.enabled = enabled2 && flag && !_isTeleporting; if (GUI.Button(new Rect(innerX + num4 + 10f, num3, num4, 40f), UseChinese() ? "\ud83c\udfe0 传回卡车(自己)" : "\ud83c\udfe0 To Truck (Self)", _sBtnNormal) && (Object)(object)PlayerController.instance != (Object)null && flag) { PlayerAvatar playerAvatarScript = PlayerController.instance.playerAvatarScript; PlayerAvatar val6 = ((playerAvatarScript != null) ? ((Component)playerAvatarScript).GetComponent() : null); if ((Object)(object)val6 != (Object)null) { try { TeleportPlayer(val6, truckPosition); } catch { } } } GUI.enabled = enabled2 && flag && array != null && array.Length != 0 && !_isTeleporting; if (GUI.Button(new Rect(innerX + (num4 + 10f) * 2f, num3, num4, 40f), UseChinese() ? "\ud83d\ude9a 全体传回卡车" : "\ud83d\ude9a To Truck (All)", _sBtnNormal) && array != null && flag) { List list4 = new List(); PlayerAvatar[] array2 = array; foreach (PlayerAvatar val7 in array2) { if ((Object)(object)val7 != (Object)null) { list4.Add(val7); } } if (list4.Count > 0) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayersWithDelayCoroutine(list4, PlayerTeleportType.ToTruck)); } } GUI.enabled = enabled2 && array != null && array.Length != 0 && !_isTeleporting; if (GUI.Button(new Rect(innerX + (num4 + 10f) * 3f, num3, num4, 40f), UseChinese() ? "\ud83d\udc80 死亡拉到面前" : "\ud83d\udc80 Pull Dead to Front", _sBtnNormal) && array != null && (Object)(object)PlayerController.instance != (Object)null) { List list5 = new List(); PlayerAvatar[] array2 = array; foreach (PlayerAvatar val8 in array2) { if (!((Object)(object)val8 == (Object)null) && !PlayerAvatarIsLocalRef.Invoke(val8) && PlayerAvatarDeadSetRef.Invoke(val8)) { list5.Add(val8); } } if (list5.Count > 0) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayersWithDelayCoroutine(list5, PlayerTeleportType.PullToFront)); } } num3 += 50f; ExtractionPoint[] array3 = Object.FindObjectsOfType(); bool flag2 = false; if (array3 != null) { ExtractionPoint[] array4 = array3; foreach (ExtractionPoint val9 in array4) { if ((Object)(object)val9 == (Object)null) { continue; } try { if (!ExtractionPointIsShopRef.Invoke(val9)) { flag2 = true; break; } } catch { } } } GUI.enabled = enabled2 && flag2 && !_isTeleporting; if (GUI.Button(new Rect(innerX, num3, num4, 40f), UseChinese() ? "\ud83c\udfe0 送提取点(自己)" : "\ud83c\udfe0 To Ext (Self)", _sBtnNormal) && (Object)(object)PlayerController.instance != (Object)null) { PlayerAvatar playerAvatarScript2 = PlayerController.instance.playerAvatarScript; PlayerAvatar val10 = ((playerAvatarScript2 != null) ? ((Component)playerAvatarScript2).GetComponent() : null); if ((Object)(object)val10 != (Object)null) { ExtractionPoint anyActiveExtractionPoint = GetAnyActiveExtractionPoint(); if ((Object)(object)anyActiveExtractionPoint != (Object)null) { Vector3 extractionPointButtonPosition = GetExtractionPointButtonPosition(anyActiveExtractionPoint); if (extractionPointButtonPosition != Vector3.zero) { try { TeleportPlayer(val10, extractionPointButtonPosition); } catch { } } } } } GUI.enabled = enabled2 && flag2 && array != null && array.Length != 0 && !_isTeleporting; if (GUI.Button(new Rect(innerX + num4 + 10f, num3, num4, 40f), UseChinese() ? "\ud83d\ude9a 全体送提取点" : "\ud83d\ude9a To Ext (All)", _sBtnNormal) && array != null) { List list6 = new List(); PlayerAvatar[] array2 = array; foreach (PlayerAvatar val11 in array2) { if ((Object)(object)val11 != (Object)null) { list6.Add(val11); } } if (list6.Count > 0) { ((MonoBehaviour)Instance).StartCoroutine(TeleportPlayersWithDelayCoroutine(list6, PlayerTeleportType.ToExtractionButton)); } } GUI.enabled = enabled2; curY += num2 + 16f; float num6 = 210f; Rect val12 = default(Rect); ((Rect)(ref val12))..ctor(curX, curY, curW, num6); GUI.Box(val12, "", _sSection); DrawBorderRect(val12, _texBorder); float num7 = curY + 12f; bool num8 = !PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient; string text3 = (UseChinese() ? "\ud83d\udd04 自动复活场景配置" : "\ud83d\udd04 Auto Revive Configurations"); if (!num8) { text3 += (UseChinese() ? " (仅房主可用 / Host Only)" : " (Host Only)"); } GUI.Label(new Rect(innerX, num7, innerW, 24f), text3, _sTitle); num7 += 32f; bool enabled3 = GUI.enabled; if (!num8) { GUI.enabled = false; } bool[] array5 = new bool[5] { _cfgReviveHeadOnTruck.Value, _cfgReviveHeadOnExtraction.Value, _cfgReviveHeadOnCart.Value, _cfgAutoReviveTeammates.Value, _cfgAutoReviveWhenSeen.Value }; string[] array6 = ((!UseChinese()) ? new string[5] { "\ud83d\ude9a Truck", "\ud83d\udce6 Extraction", "\ud83d\uded2 Cart", "\ud83d\udc80 5s timer", "\ud83d\udc41\ufe0f Seen" } : new string[5] { "\ud83d\ude9a 卡车上", "\ud83d\udce6 提取点", "\ud83d\uded2 推车上", "\ud83d\udc80 5秒后", "\ud83d\udc41\ufe0f 被发现" }); float num9 = (innerW - 40f) / 5f; for (int j = 0; j < 5; j++) { if (GUI.Button(new Rect(innerX + (float)j * (num9 + 10f), num7, num9, 30f), array6[j], array5[j] ? _sBtnGreen : _sBtnNormal)) { bool value = !array5[j]; switch (j) { case 0: _cfgReviveHeadOnTruck.Value = value; break; case 1: _cfgReviveHeadOnExtraction.Value = value; break; case 2: _cfgReviveHeadOnCart.Value = value; break; case 3: _cfgAutoReviveTeammates.Value = value; break; case 4: _cfgAutoReviveWhenSeen.Value = value; break; } SaveRuntimeConfig(); } } num7 += 38f; bool flag3 = DrawStyledToggle(new Rect(innerX, num7, innerW, 30f), _cfgReviveAutoToTruck.Value, UseChinese() ? "\ud83d\ude9a 复活后自动传送回卡车 (默认关闭)" : "\ud83d\ude9a After revive, auto-teleport to truck (default OFF)"); if (flag3 != _cfgReviveAutoToTruck.Value) { _cfgReviveAutoToTruck.Value = flag3; SaveRuntimeConfig(); } num7 += 38f; bool flag4 = DrawStyledToggle(new Rect(innerX, num7, innerW, 30f), _cfgDeathAutoToExtraction.Value, UseChinese() ? "\ud83d\udc80 死亡后自动传送到提取点 (默认关闭)" : "\ud83d\udc80 After death, auto-teleport to extraction point (default OFF)"); if (flag4 != _cfgDeathAutoToExtraction.Value) { _cfgDeathAutoToExtraction.Value = flag4; SaveRuntimeConfig(); } num7 += 38f; bool flag5 = DrawStyledToggle(new Rect(innerX, num7, innerW, 30f), _cfgDeathAutoToTruck.Value, UseChinese() ? "\ud83d\udc80 死亡后自动传送到卡车 (默认关闭)" : "\ud83d\udc80 After death, auto-teleport to truck (default OFF)"); if (flag5 != _cfgDeathAutoToTruck.Value) { _cfgDeathAutoToTruck.Value = flag5; SaveRuntimeConfig(); } GUI.enabled = enabled3; curY += num6 + 16f; float num10 = 150f; Rect val13 = default(Rect); ((Rect)(ref val13))..ctor(curX, curY, curW, num10); GUI.Box(val13, "", _sSection); DrawBorderRect(val13, _texBorder); float num11 = curY + 12f; GUI.Label(new Rect(innerX, num11, innerW, 24f), UseChinese() ? "\ud83d\udce6 关卡提取点传送" : "\ud83d\udce6 Extraction Points Teleport", _sTitle); num11 += 32f; if (Time.time - _lastExtractionPointRefreshTime >= 2f) { _lastExtractionPointRefreshTime = Time.time; ExtractionPoint[] array7 = Object.FindObjectsOfType(); _cachedExtractionPoints.Clear(); if (array7 != null) { ExtractionPoint[] array4 = array7; foreach (ExtractionPoint val14 in array4) { if ((Object)(object)val14 != (Object)null && !ExtractionPointIsShopRef.Invoke(val14)) { _cachedExtractionPoints.Add(val14); } } } Vector3 refTruckPos = GetTruckPosition(); if (refTruckPos != Vector3.zero) { _cachedExtractionPoints = _cachedExtractionPoints.OrderBy((ExtractionPoint ep) => Vector3.Distance(((Component)ep).transform.position, refTruckPos)).ToList(); } else { _cachedExtractionPoints = (from ep in _cachedExtractionPoints orderby ((Component)ep).transform.position.x, ((Component)ep).transform.position.z select ep).ToList(); } } _cachedExtractionPoints.RemoveAll((ExtractionPoint ep) => (Object)(object)ep == (Object)null); if (_cachedExtractionPoints.Count == 0) { GUI.Label(new Rect(innerX, num11 + 15f, innerW, 30f), UseChinese() ? "⚠\ufe0f 当前没有可用的提取点" : "⚠\ufe0f No extraction points available", _sStatus); } else { int count = _cachedExtractionPoints.Count; float num12 = (innerW - (float)(count - 1) * 10f) / (float)count; for (int num13 = 0; num13 < count; num13++) { ExtractionPoint val15 = _cachedExtractionPoints[num13]; if ((Object)(object)val15 == (Object)null) { continue; } float num14 = innerX + (float)num13 * (num12 + 10f); State val16 = ExtractionPointCurrentStateRef.Invoke(val15); bool num15 = (int)val16 == 7 || (int)val16 == 3; bool isLocked = val15.isLocked; string text4 = (num15 ? (UseChinese() ? "已提交" : "Completed") : ((!isLocked) ? (UseChinese() ? "已开启" : "Unlocked") : (UseChinese() ? "未开启" : "Locked"))); GUIStyle val17 = (num15 ? _sLabelEpComplete : ((!isLocked) ? _sLabelEpUnlocked : _sLabelEpLocked)); string text5 = (UseChinese() ? "提取点 " : "Extract ") + (num13 + 1) + " (" + text4 + ")"; GUI.Label(new Rect(num14, num11, num12, 22f), text5, val17); if (GUI.Button(new Rect(num14, num11 + 28f, num12, 30f), UseChinese() ? "本人传送" : "Teleport Self", _sBtnNormal) && (Object)(object)PlayerController.instance != (Object)null) { PlayerAvatar playerAvatarScript3 = PlayerController.instance.playerAvatarScript; PlayerAvatar val18 = ((playerAvatarScript3 != null) ? ((Component)playerAvatarScript3).GetComponent() : null); if ((Object)(object)val18 != (Object)null) { Vector3 extractionPointButtonPosition2 = GetExtractionPointButtonPosition(val15); if (extractionPointButtonPosition2 != Vector3.zero) { try { TeleportPlayer(val18, extractionPointButtonPosition2); } catch { } } } } if (!GUI.Button(new Rect(num14, num11 + 62f, num12, 30f), UseChinese() ? "全体传送" : "Teleport All", _sBtnNormal) || array == null) { continue; } Vector3 extractionPointButtonPosition3 = GetExtractionPointButtonPosition(val15); if (!(extractionPointButtonPosition3 != Vector3.zero)) { continue; } PlayerAvatar[] array2 = array; foreach (PlayerAvatar val19 in array2) { if ((Object)(object)val19 != (Object)null) { try { TeleportPlayer(val19, extractionPointButtonPosition3); } catch { } } } } } curY += num10 + 16f; float num16 = ((num == 0) ? 30f : ((float)num * 38f)); float num17 = 266f; float num18 = 124f + Mathf.Min(num16, num17); Rect val20 = default(Rect); ((Rect)(ref val20))..ctor(curX, curY, curW, num18); GUI.Box(val20, "", _sSection); DrawBorderRect(val20, _texBorder); float num19 = curY + 12f; GUI.Label(new Rect(innerX, num19, 300f, 24f), UseChinese() ? "\ud83d\udc65 联机房间玩家控制" : "\ud83d\udc65 Player Management", _sTitle); GUI.Label(new Rect(innerX + 320f, num19 + 2f, 500f, 24f), UseChinese() ? "\ud83d\udca1 最左侧勾选框控制单人无敌状态" : "\ud83d\udca1 Checkbox on the left controls individual God Mode", _sStatus); num19 += 34f; float num20 = 26f; float num21 = num19 + (38f - num20) * 0.5f; Rect val21 = default(Rect); ((Rect)(ref val21))..ctor(innerX, num21, num20, num20); bool enabled4 = GUI.enabled; bool flag6 = !SemiFunc.IsMultiplayer() || PhotonNetwork.IsMasterClient; GUI.enabled = enabled4 && flag6; bool value2 = _cfgAllTeammatesGodMode.Value; bool flag7 = GUI.Toggle(val21, value2, "", GUIStyle.none); if (flag7 != value2) { _cfgAllTeammatesGodMode.Value = flag7; OnAllTeammatesGodModeChanged(flag7); SaveRuntimeConfig(); } GUI.enabled = enabled4; if (value2) { GUI.DrawTexture(val21, (Texture)(object)_texGreen); GUI.Label(val21, "✓", _sCheckmarkStyleWhite); } else { GUI.Box(val21, "", _sSection); DrawBorderRect(val21, _texBorder); } GUI.Label(new Rect(innerX + 34f, num19 + 4f, 400f, 30f), UseChinese() ? "\ud83d\udee1\ufe0f 全体无敌 (全选/反选)" : "\ud83d\udee1\ufe0f All Teammates God Mode (Toggle All)", _sToggleOn); num19 += 38f; if (num == 0) { GUI.Label(new Rect(innerX, num19, innerW, 24f), UseChinese() ? "等待联机玩家加载..." : "Waiting for players to load...", _sLabel); } else { Array.Sort(array, delegate(PlayerAvatar a, PlayerAvatar b) { if ((Object)(object)a == (Object)null || (Object)(object)b == (Object)null) { return 0; } bool flag16 = PlayerAvatarIsLocalRef.Invoke(a); bool flag17 = PlayerAvatarIsLocalRef.Invoke(b); if (flag16 && !flag17) { return -1; } return (!flag16 && flag17) ? 1 : string.Compare(GetPlayerDisplayName(a), GetPlayerDisplayName(b), StringComparison.OrdinalIgnoreCase); }); float num22 = num18 - 110f; Rect val22 = new Rect(innerX, num19, innerW, num22); Rect val23 = default(Rect); ((Rect)(ref val23))..ctor(0f, 0f, innerW - 16f, num16); _playerScrollPos = GUI.BeginScrollView(val22, _playerScrollPos, val23); bool enabled5 = GUI.enabled; float num23 = 0f; PlayerAvatar[] array2 = array; Rect val25 = default(Rect); foreach (PlayerAvatar val24 in array2) { if ((Object)(object)val24 == (Object)null) { continue; } bool flag8 = PlayerAvatarIsLocalRef.Invoke(val24); string playerDisplayName = GetPlayerDisplayName(val24); bool flag9 = PlayerAvatarDeadSetRef.Invoke(val24); bool num24 = (Object)(object)val24.photonView != (Object)null && val24.photonView.Owner != null && val24.photonView.Owner.IsMasterClient; string text6 = playerDisplayName; if (flag8) { text6 += (UseChinese() ? " (我)" : " (Me)"); } if (num24) { text6 = (UseChinese() ? "[房主] " : "[Host] ") + text6; } if (flag9) { text6 = (UseChinese() ? "死亡 " : "Dead ") + text6; } float num25 = 32f; float num26 = 6f; bool flag10 = (GUI.enabled = enabled5); float num27 = 26f; float num28 = num23 + (38f - num27) * 0.5f; ((Rect)(ref val25))..ctor(0f, num28, num27, num27); string text7 = PlayerAvatarSteamIDRef.Invoke(val24); bool flag12 = IsPlayerManualGodMode(text7); bool flag13 = false; try { if ((Object)(object)PlayerController.instance != (Object)null && PlayerSteamIDRef.Invoke(PlayerController.instance) == text7) { flag13 = true; } } catch { } bool flag14 = flag13 || !SemiFunc.IsMultiplayer() || PhotonNetwork.IsMasterClient; GUI.enabled = flag10 && flag14; bool flag15 = GUI.Toggle(val25, flag12, "", GUIStyle.none); if (flag15 != flag12) { SetPlayerGodMode(text7, flag15); if (!flag15) { _cfgAllTeammatesGodMode.Value = false; SaveRuntimeConfig(); } } if (flag12) { GUI.DrawTexture(val25, (Texture)(object)_texGreen); GUI.Label(val25, "✓", _sCheckmarkStyleWhite); } else { GUI.Box(val25, "", _sSection); DrawBorderRect(val25, _texBorder); } GUI.enabled = flag10; Color textColor = _sLabel.normal.textColor; if (flag9) { _sLabel.normal.textColor = new Color(1f, 0.35f, 0.35f); } GUI.Label(new Rect(num27 + 8f, num23 + 4f, 210f, 30f), text6, _sLabel); _sLabel.normal.textColor = textColor; float num29 = 250f; GUI.enabled = flag10 && !flag9; if (GUI.Button(new Rect(num29, num23 + 1f, 60f, num25), UseChinese() ? "杀死" : "Kill", _sBtnRed)) { KillPlayer(val24); } num29 += 60f + num26; GUI.enabled = flag10 && flag9; if (GUI.Button(new Rect(num29, num23 + 1f, 60f, num25), UseChinese() ? "复活" : "Revive", _sBtnGreen)) { RevivePlayer(val24); } num29 += 60f + num26; GUI.enabled = flag10 && !flag9; if (GUI.Button(new Rect(num29, num23 + 1f, 60f, num25), UseChinese() ? "满血" : "Heal", _sBtnNormal)) { HealPlayer(val24); } num29 += 60f + num26; GUI.enabled = flag10 && !flag8 && (Object)(object)PlayerController.instance != (Object)null && !_isTeleporting; if (GUI.Button(new Rect(num29, num23 + 1f, 85f, num25), UseChinese() ? "拉过来" : "Pull", _sBtnNormal) && (Object)(object)PlayerController.instance != (Object)null) { Vector3 spawnPosition = GetSpawnPosition(); TeleportPlayer(val24, spawnPosition); } num29 += 85f + num26; GUI.enabled = flag10 && !flag8 && (Object)(object)PlayerController.instance != (Object)null && !_isTeleporting; if (GUI.Button(new Rect(num29, num23 + 1f, 85f, num25), UseChinese() ? "飞过去" : "Goto", _sBtnNormal)) { try { Vector3 position = GetPlayerPosition(val24) + Vector3.up * 0.5f; PlayerAvatar playerAvatarScript4 = PlayerController.instance.playerAvatarScript; PlayerAvatar val26 = ((playerAvatarScript4 != null) ? ((Component)playerAvatarScript4).GetComponent() : null); if ((Object)(object)val26 != (Object)null) { TeleportPlayer(val26, position); } } catch { } } num29 += 85f + num26; GUI.enabled = flag10 && !flag8 && (Object)(object)PlayerController.instance != (Object)null && !_isTeleporting; if (GUI.Button(new Rect(num29, num23 + 1f, 100f, num25), UseChinese() ? "送提取点" : "To Ext", _sBtnNormal)) { try { ExtractionPoint anyActiveExtractionPoint2 = GetAnyActiveExtractionPoint(); if ((Object)(object)anyActiveExtractionPoint2 != (Object)null) { Vector3 extractionPointButtonPosition4 = GetExtractionPointButtonPosition(anyActiveExtractionPoint2); if (extractionPointButtonPosition4 != Vector3.zero) { TeleportPlayer(val24, extractionPointButtonPosition4); } } } catch { } } num23 += 38f; } GUI.EndScrollView(); } curY += num18 + 16f; GUI.enabled = enabled; } private void DrawConfirmSpawnDialog() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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) GUI.enabled = true; float num = 460f; float num2 = 220f; float num3 = (((Rect)(ref _windowRect)).width - num) * 0.5f; float num4 = (((Rect)(ref _windowRect)).height - num2) * 0.5f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num3, num4, num, num2); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); float num5 = num4 + 20f; string text = (UseChinese() ? "⚠\ufe0f 批量刷取确认" : "⚠\ufe0f Batch Spawn Confirm"); GUI.Label(new Rect(num3 + 20f, num5, num - 40f, 30f), text, _sTitle); num5 += 40f; string displayName = _pendingSpawnInfo.GetDisplayName(); string text2 = (UseChinese() ? $"确定要刷取数量为 {_spawnCount} 的物品吗?\n物品: {displayName}" : $"Are you sure to spawn {_spawnCount} items?\nItem: {displayName}"); GUI.Label(new Rect(num3 + 20f, num5, num - 40f, 60f), text2, _sMsgStyle); num5 += 70f; float num6 = 120f; float num7 = 36f; float num8 = 40f; float num9 = num3 + (num - (num6 * 2f + num8)) * 0.5f; string text3 = (UseChinese() ? "确认" : "Confirm"); if (GUI.Button(new Rect(num9, num5, num6, num7), text3, _sBtnGreen)) { SpawnObject(_pendingSpawnInfo); _showConfirmSpawn = false; _pendingSpawnInfo = null; } string text4 = (UseChinese() ? "取消" : "Cancel"); if (GUI.Button(new Rect(num9 + num6 + num8, num5, num6, num7), text4, _sBtnRed)) { _showConfirmSpawn = false; _pendingSpawnInfo = null; } } private void DrawConfirmKillAllTeammatesDialog() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_01df: Unknown result type (might be due to invalid IL or missing references) GUI.enabled = true; float num = 460f; float num2 = 220f; float num3 = (((Rect)(ref _windowRect)).width - num) * 0.5f; float num4 = (((Rect)(ref _windowRect)).height - num2) * 0.5f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num3, num4, num, num2); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); float num5 = num4 + 20f; string text = (UseChinese() ? "⚠\ufe0f 杀死全部玩家确认" : "⚠\ufe0f Kill All Teammates Confirm"); GUI.Label(new Rect(num3 + 20f, num5, num - 40f, 30f), text, _sTitle); num5 += 40f; string text2 = (UseChinese() ? "确定要杀死场景中的全部玩家吗?" : "Are you sure you want to kill all teammates in the scene?"); GUI.Label(new Rect(num3 + 20f, num5, num - 40f, 60f), text2, _sMsgStyle); num5 += 60f; float num6 = 120f; float num7 = 36f; float num8 = 40f; float num9 = num3 + (num - (num6 * 2f + num8)) * 0.5f; string text3 = (UseChinese() ? "确认" : "Confirm"); if (GUI.Button(new Rect(num9, num5, num6, num7), text3, _sBtnGreen)) { List list = SemiFunc.PlayerGetList(); if (list != null) { foreach (PlayerAvatar item in list) { try { if ((Object)(object)item != (Object)null && !PlayerAvatarDeadSetRef.Invoke(item)) { item.PlayerDeath(-1); } } catch { } } } _showConfirmKillAllTeammates = false; } string text4 = (UseChinese() ? "取消" : "Cancel"); if (GUI.Button(new Rect(num9 + num6 + num8, num5, num6, num7), text4, _sBtnRed)) { _showConfirmKillAllTeammates = false; } } private void DrawTabItemControl(float curX, ref float curY, float curW, float innerX, float innerW) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_0906: Unknown result type (might be due to invalid IL or missing references) //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) //IL_0ad2: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Unknown result type (might be due to invalid IL or missing references) //IL_0b9f: Unknown result type (might be due to invalid IL or missing references) //IL_0c1a: Unknown result type (might be due to invalid IL or missing references) //IL_0c49: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Unknown result type (might be due to invalid IL or missing references) //IL_0ff7: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Unknown result type (might be due to invalid IL or missing references) //IL_0f57: Unknown result type (might be due to invalid IL or missing references) //IL_0fa2: Unknown result type (might be due to invalid IL or missing references) //IL_0fc6: Unknown result type (might be due to invalid IL or missing references) //IL_0f91: Unknown result type (might be due to invalid IL or missing references) //IL_0e0d: Unknown result type (might be due to invalid IL or missing references) //IL_0e55: Unknown result type (might be due to invalid IL or missing references) bool enabled = GUI.enabled; if (!IsStaticModEnabled()) { GUI.enabled = false; } string text = (UseChinese() ? "\ud83d\udd04 重置全部物品选项" : "\ud83d\udd04 Reset All Item Settings"); if (GUI.Button(new Rect(curX, curY, curW, 40f), text, _sBtnRed) && _cfgValuableGodMode != null) { _cfgValuableGodMode.Value = false; _cfgValuableGodModeBead.Value = false; _cfgValuableGodModeWeapon.Value = false; _cfgValuableGodModeVehicle.Value = false; _cfgValuableGodModeCosmetic.Value = false; if (_cfgValuableGodModePotion != null) { _cfgValuableGodModePotion.Value = false; } if (_cfgValuableGodModeBattery != null) { _cfgValuableGodModeBattery.Value = false; } UpdateValuablesGodModeState(forceDisableAll: true); _itemTeleportValuable = true; _itemTeleportBead = true; _itemTeleportWeapon = false; _itemTeleportVehicle = false; _itemTeleportCosmetic = true; _itemTeleportPotion = true; _itemTeleportBattery = true; _itemTeleportCountSlider = 11f; _itemTeleportInterval = 0.3f; SaveRuntimeConfig(); } curY += 52f; float num = 132f; Rect val = default(Rect); ((Rect)(ref val))..ctor(curX, curY, curW, num); GUI.Box(val, "", _sSection); DrawBorderRect(val, _texBorder); float num2 = curY + 12f; GUI.Label(new Rect(innerX, num2, 400f, 26f), UseChinese() ? "\ud83d\udee1\ufe0f 物品常驻无敌分类配置" : "\ud83d\udee1\ufe0f Permanent Indestructible Settings", _sTitle); string text2 = (UseChinese() ? "☑\ufe0f 全选" : "☑\ufe0f All"); if (GUI.Button(new Rect(innerX + innerW - 200f, num2, 95f, 26f), text2, _sBtnNormal)) { _cfgValuableGodMode.Value = true; _cfgValuableGodModeBead.Value = true; _cfgValuableGodModeWeapon.Value = true; _cfgValuableGodModeVehicle.Value = true; _cfgValuableGodModeCosmetic.Value = true; _cfgValuableGodModePotion.Value = true; _cfgValuableGodModeHealPack.Value = true; _cfgValuableGodModeBattery.Value = true; _cfgValuableGodModeMoneyBag.Value = true; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } string text3 = (UseChinese() ? "\ud83d\udd04 反选" : "\ud83d\udd04 Invert"); if (GUI.Button(new Rect(innerX + innerW - 95f, num2, 95f, 26f), text3, _sBtnNormal)) { _cfgValuableGodMode.Value = !_cfgValuableGodMode.Value; _cfgValuableGodModeBead.Value = !_cfgValuableGodModeBead.Value; _cfgValuableGodModeWeapon.Value = !_cfgValuableGodModeWeapon.Value; _cfgValuableGodModeVehicle.Value = !_cfgValuableGodModeVehicle.Value; _cfgValuableGodModeCosmetic.Value = !_cfgValuableGodModeCosmetic.Value; _cfgValuableGodModePotion.Value = !_cfgValuableGodModePotion.Value; _cfgValuableGodModeHealPack.Value = !_cfgValuableGodModeHealPack.Value; _cfgValuableGodModeBattery.Value = !_cfgValuableGodModeBattery.Value; _cfgValuableGodModeMoneyBag.Value = !_cfgValuableGodModeMoneyBag.Value; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } num2 += 34f; float num3 = (innerW - 24f) / 5f; bool value = _cfgValuableGodMode.Value; bool flag = DrawStyledToggle(new Rect(innerX, num2, num3, 30f), value, UseChinese() ? "\ud83d\udc8e 贵重物品" : "\ud83d\udc8e Valuables"); if (flag != value) { _cfgValuableGodMode.Value = flag; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value2 = _cfgValuableGodModeBead.Value; bool flag2 = DrawStyledToggle(new Rect(innerX + num3 + 6f, num2, num3, 30f), value2, UseChinese() ? "\ud83d\udd2e 滚动珠子" : "\ud83d\udd2e Beads"); if (flag2 != value2) { _cfgValuableGodModeBead.Value = flag2; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value3 = _cfgValuableGodModeWeapon.Value; bool flag3 = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 2f, num2, num3, 30f), value3, UseChinese() ? "⚔\ufe0f 武器装备" : "⚔\ufe0f Weapons"); if (flag3 != value3) { _cfgValuableGodModeWeapon.Value = flag3; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value4 = _cfgValuableGodModeVehicle.Value; bool flag4 = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 3f, num2, num3, 30f), value4, UseChinese() ? "\ud83c\udfce\ufe0f 载具推车" : "\ud83c\udfce\ufe0f Vehicles"); if (flag4 != value4) { _cfgValuableGodModeVehicle.Value = flag4; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value5 = _cfgValuableGodModeCosmetic.Value; bool flag5 = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 4f, num2, num3, 30f), value5, UseChinese() ? "\ud83c\udf81 装饰箱子" : "\ud83c\udf81 Cosmetic Box"); if (flag5 != value5) { _cfgValuableGodModeCosmetic.Value = flag5; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } num2 += 34f; bool value6 = _cfgValuableGodModePotion.Value; bool flag6 = DrawStyledToggle(new Rect(innerX, num2, num3, 30f), value6, UseChinese() ? "\ud83e\uddea 升级药水" : "\ud83e\uddea Upgrade Potions"); if (flag6 != value6) { _cfgValuableGodModePotion.Value = flag6; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value7 = _cfgValuableGodModeHealPack.Value; bool flag7 = DrawStyledToggle(new Rect(innerX + num3 + 6f, num2, num3, 30f), value7, UseChinese() ? "\ud83d\udc8a 加血包" : "\ud83d\udc8a Health Packs"); if (flag7 != value7) { _cfgValuableGodModeHealPack.Value = flag7; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value8 = _cfgValuableGodModeBattery.Value; bool flag8 = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 2f, num2, num3, 30f), value8, UseChinese() ? "\ud83d\udd0b 电池能量" : "\ud83d\udd0b Batteries"); if (flag8 != value8) { _cfgValuableGodModeBattery.Value = flag8; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } bool value9 = _cfgValuableGodModeMoneyBag.Value; bool flag9 = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 3f, num2, num3, 30f), value9, UseChinese() ? "\ud83d\udcb0 钱袋子" : "\ud83d\udcb0 Money Bags"); if (flag9 != value9) { _cfgValuableGodModeMoneyBag.Value = flag9; UpdateValuablesGodModeState(); SaveRuntimeConfig(); } curY += num + 16f; float num4 = (_isTeleporting ? 475f : 445f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(curX, curY, curW, num4); GUI.Box(val2, "", _sSection); DrawBorderRect(val2, _texBorder); num2 = curY + 12f; GUI.Label(new Rect(innerX, num2, 400f, 26f), UseChinese() ? "\ud83d\udce6 物品一键传送面板" : "\ud83d\udce6 Items Teleport Panel", _sTitle); if (GUI.Button(new Rect(innerX + innerW - 200f, num2, 95f, 26f), text2, _sBtnNormal)) { _itemTeleportValuable = true; _itemTeleportBead = true; _itemTeleportWeapon = true; _itemTeleportVehicle = true; _itemTeleportCosmetic = true; _itemTeleportPotion = true; _itemTeleportHealPack = true; _itemTeleportBattery = true; _itemTeleportMoneyBag = true; } if (GUI.Button(new Rect(innerX + innerW - 95f, num2, 95f, 26f), text3, _sBtnNormal)) { _itemTeleportValuable = !_itemTeleportValuable; _itemTeleportBead = !_itemTeleportBead; _itemTeleportWeapon = !_itemTeleportWeapon; _itemTeleportVehicle = !_itemTeleportVehicle; _itemTeleportCosmetic = !_itemTeleportCosmetic; _itemTeleportPotion = !_itemTeleportPotion; _itemTeleportHealPack = !_itemTeleportHealPack; _itemTeleportBattery = !_itemTeleportBattery; _itemTeleportMoneyBag = !_itemTeleportMoneyBag; } num2 += 30f; _itemTeleportValuable = DrawStyledToggle(new Rect(innerX, num2, num3, 30f), _itemTeleportValuable, UseChinese() ? "\ud83d\udc8e 贵重物品" : "\ud83d\udc8e Valuables"); _itemTeleportBead = DrawStyledToggle(new Rect(innerX + num3 + 6f, num2, num3, 30f), _itemTeleportBead, UseChinese() ? "\ud83d\udd2e 滚动珠子" : "\ud83d\udd2e Beads"); _itemTeleportWeapon = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 2f, num2, num3, 30f), _itemTeleportWeapon, UseChinese() ? "⚔\ufe0f 武器装备" : "⚔\ufe0f Weapons"); _itemTeleportVehicle = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 3f, num2, num3, 30f), _itemTeleportVehicle, UseChinese() ? "\ud83c\udfce\ufe0f 载具推车" : "\ud83c\udfce\ufe0f Vehicles"); _itemTeleportCosmetic = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 4f, num2, num3, 30f), _itemTeleportCosmetic, UseChinese() ? "\ud83c\udf81 装饰箱子" : "\ud83c\udf81 Cosmetic Box"); num2 += 34f; _itemTeleportPotion = DrawStyledToggle(new Rect(innerX, num2, num3, 30f), _itemTeleportPotion, UseChinese() ? "\ud83e\uddea 升级药水" : "\ud83e\uddea Upgrade Potions"); _itemTeleportHealPack = DrawStyledToggle(new Rect(innerX + num3 + 6f, num2, num3, 30f), _itemTeleportHealPack, UseChinese() ? "\ud83d\udc8a 加血包" : "\ud83d\udc8a Health Packs"); _itemTeleportBattery = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 2f, num2, num3, 30f), _itemTeleportBattery, UseChinese() ? "\ud83d\udd0b 电池能量" : "\ud83d\udd0b Batteries"); _itemTeleportMoneyBag = DrawStyledToggle(new Rect(innerX + (num3 + 6f) * 3f, num2, num3, 30f), _itemTeleportMoneyBag, UseChinese() ? "\ud83d\udcb0 钱袋子" : "\ud83d\udcb0 Money Bags"); num2 += 36f; _itemExcludeTruckAndExtraction = DrawStyledToggle(new Rect(innerX, num2, innerW, 30f), _itemExcludeTruckAndExtraction, UseChinese() ? "\ud83d\udee1\ufe0f 排除卡车/提取点安全物品" : "\ud83d\udee1\ufe0f Exclude Secured Items"); num2 += 38f; int num5 = Mathf.RoundToInt(_itemTeleportCountSlider); string text4 = (UseChinese() ? ("限制数量: " + ((num5 == 11) ? "全部 (All)" : (num5 + " 个"))) : ("Max Quantity: " + ((num5 == 11) ? "All" : num5.ToString()))); GUI.Label(new Rect(innerX, num2, 250f, 24f), text4, _sLabel); float num6 = GUI.HorizontalSlider(new Rect(innerX + 260f, num2 + 6f, innerW - 260f, 16f), _itemTeleportCountSlider, 1f, 11f); if (num6 != _itemTeleportCountSlider) { _itemTeleportCountSlider = num6; } num2 += 28f; string text5 = (UseChinese() ? $"传送间隔: {_itemTeleportInterval:F1} 秒" : $"Interval: {_itemTeleportInterval:F1}s"); GUI.Label(new Rect(innerX, num2, 250f, 24f), text5, _sLabel); float num7 = GUI.HorizontalSlider(new Rect(innerX + 260f, num2 + 6f, innerW - 260f, 16f), _itemTeleportInterval, 0.1f, 2f); num7 = Mathf.Round(num7 * 10f) / 10f; if (num7 != _itemTeleportInterval) { _itemTeleportInterval = num7; } num2 += 34f; float num8 = (innerW - 36f) / 4f; bool flag10 = (Object)(object)PlayerController.instance != (Object)null; bool enabled2 = GUI.enabled; bool flag11 = _itemTeleportValuable || _itemTeleportBead || _itemTeleportWeapon || _itemTeleportVehicle || _itemTeleportCosmetic || _itemTeleportPotion || _itemTeleportHealPack || _itemTeleportBattery || _itemTeleportMoneyBag; if (_isTeleporting) { GUI.enabled = enabled2; string text6 = (UseChinese() ? "❌ 取消传送" : "❌ Cancel Teleport"); if (GUI.Button(new Rect(innerX, num2, innerW, 38f), text6, _sBtnRed)) { CancelTeleportOperation(); } } else { if (!flag10 || !flag11) { GUI.enabled = false; } string text7 = (UseChinese() ? "\ud83d\ude80 传送到面前" : "\ud83d\ude80 To Front"); if (GUI.Button(new Rect(innerX, num2, num8, 38f), text7, _sBtnGreen)) { TeleportSelectedObjectsToFront(); } string text8 = (UseChinese() ? "\ud83d\uded2 传送到车上" : "\ud83d\uded2 To Cart"); if (GUI.Button(new Rect(innerX + num8 + 12f, num2, num8, 38f), text8, _sBtnGreen)) { TeleportSelectedObjectsToCart(); } string text9 = (UseChinese() ? "\ud83c\udfe0 传送到提取点" : "\ud83c\udfe0 To Extraction"); if (GUI.Button(new Rect(innerX + (num8 + 12f) * 2f, num2, num8, 38f), text9, _sBtnGreen)) { TeleportSelectedObjectsToExtractionPoint(); } string text10 = (UseChinese() ? "\ud83c\udfb2 随机分布" : "\ud83c\udfb2 Scatter"); if (GUI.Button(new Rect(innerX + (num8 + 12f) * 3f, num2, num8, 38f), text10, _sBtnNormal)) { TeleportSelectedObjectsToRandom(); } } GUI.enabled = enabled2; num2 += 46f; if (_isTeleporting && _teleportTotalCount > 0) { string text11 = (UseChinese() ? $"⚡ {_teleportStatusText}: {_teleportCurrentIndex} / {_teleportTotalCount} ({(float)_teleportCurrentIndex / (float)_teleportTotalCount * 100f:F0}%)" : $"⚡ {_teleportStatusText}: {_teleportCurrentIndex} / {_teleportTotalCount} ({(float)_teleportCurrentIndex / (float)_teleportTotalCount * 100f:F0}%)"); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(innerX, num2, innerW, 24f); GUI.Box(val3, "", _sSection); float num9 = innerW * ((float)_teleportCurrentIndex / (float)_teleportTotalCount); if (num9 > 0f) { GUI.DrawTexture(new Rect(innerX, num2, num9, 24f), (Texture)(object)_texGreen); } DrawBorderRect(val3, _texBorder); GUI.Label(new Rect(innerX + 10f, num2, innerW - 20f, 24f), text11, _sToggleOn); num2 += 32f; } num2 += 24f; GUI.Label(new Rect(innerX, num2, innerW, 20f), UseChinese() ? "※ 提示:传送时自带 10 秒防碎保护。传送后 10 秒将根据分类的常驻无敌设置自动解除无敌。" : "* Tip: 10s temporary protection is applied. Will release in 10s based on permanent settings.", _sStatus); curY += num4 + 20f; GUI.enabled = enabled; } public static void ApplyGodModeForDetector(PhysGrabObjectImpactDetector __instance) { if ((Object)(object)__instance == (Object)null || !IsStaticModEnabled()) { return; } if (!_detectorCache.TryGetValue(__instance, out var value)) { value = new DetectorCache(); ValuableObject val = Plugin.FindComponentInHierarchy((Component)(object)__instance); if ((Object)(object)val != (Object)null) { value.IsValuable = true; value.IsBead = IsBead(val); } else if ((Object)(object)Plugin.FindComponentInHierarchy((Component)(object)__instance) != (Object)null) { value.IsWeapon = true; } else { ItemVehicle obj = Plugin.FindComponentInHierarchy((Component)(object)__instance); PhysGrabCart val2 = Plugin.FindComponentInHierarchy((Component)(object)__instance); if ((Object)(object)obj != (Object)null || (Object)(object)val2 != (Object)null) { value.IsVehicle = true; } else if ((Object)(object)Plugin.FindComponentInHierarchy((Component)(object)__instance) != (Object)null) { value.IsCosmetic = true; } else { PhysGrabObject val3 = Plugin.FindComponentInHierarchy((Component)(object)__instance); if ((Object)(object)val3 != (Object)null) { string text = ((Object)val3).name.ToLower(); if (text.Contains("upgrade") || text.Contains("potion") || text.Contains("syringe") || text.Contains("medicine") || text.Contains("heal")) { value.IsPotion = true; } else if (text.Contains("battery")) { value.IsBattery = true; } } } } _detectorCache.Add(__instance, value); } bool flag = false; if (value.IsValuable) { flag = (value.IsBead ? IsValuableGodModeBeadEnabled() : IsValuableGodModeValuableEnabled()); } else if (value.IsWeapon) { flag = IsValuableGodModeWeaponEnabled(); } else if (value.IsVehicle) { flag = IsValuableGodModeVehicleEnabled(); } else if (value.IsCosmetic) { flag = IsValuableGodModeCosmeticEnabled(); } else if (value.IsPotion) { flag = IsValuableGodModePotionEnabled(); } else if (value.IsBattery) { flag = IsValuableGodModeBatteryEnabled(); } if (flag) { DetectorIsIndestructibleRef.Invoke(__instance) = true; } } internal static void TryHookREPOConfig(Harmony h) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0162: 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_018a: Expected O, but got Unknown //IL_018a: Expected O, but got Unknown try { Type type = AccessTools.TypeByName("MenuLib.MenuAPI"); if (type == null) { Plugin instance = Instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)"MenuLib not detected, skip REPOConfig bilingual hook."); } return; } HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(REPOConfigCreateHook), "Postfix", (Type[])null, (Type[])null)); HashSet hashSet = new HashSet(StringComparer.Ordinal) { "CreateREPOLabel", "CreateREPOToggle", "CreateREPOSlider", "CreateREPOInputField", "CreateREPOButton" }; int num = 0; foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(type)) { if (!hashSet.Contains(declaredMethod.Name)) { continue; } ParameterInfo[] parameters = declaredMethod.GetParameters(); if (parameters.Length != 0 && !(parameters[0].ParameterType != typeof(string))) { try { h.Patch((MethodBase)declaredMethod, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num++; } catch { } } } try { Type type2 = AccessTools.TypeByName("REPOConfig.ConfigMenu"); if (type2 != null) { MethodInfo methodInfo = AccessTools.Method(type2, "CreateModEntries", (Type[])null, (Type[])null); if (methodInfo != null) { h.Patch((MethodBase)methodInfo, new HarmonyMethod(AccessTools.Method(typeof(REPOConfigCreateHook), "CreateModEntriesPrefix", (Type[])null, (Type[])null)), new HarmonyMethod(AccessTools.Method(typeof(REPOConfigCreateHook), "CreateModEntriesPostfix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _createModEntriesPatchInstalled = true; } } } catch { } if (num > 0) { Plugin instance2 = Instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)$"REPOConfig bilingual hook attached ({num} UI creation methods)."); } } else { Plugin instance3 = Instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogInfo((object)"REPOConfig: no patchable UI creation methods found."); } } } catch (Exception ex) { Plugin instance4 = Instance; if (instance4 != null) { ((BaseUnityPlugin)instance4).Logger.LogInfo((object)("REPOConfig hook failed: " + ex.Message)); } } } internal static void RegisterLiveLabelIfMatched(string label, object uiElement) { if (string.IsNullOrEmpty(label) || uiElement == null) { return; } string text = label.Trim().Replace("▼", "").Replace("▶", "") .Replace(" ", ""); CfgI18N cfgI18N = null; for (int i = 0; i < _cfgI18Ns.Count; i++) { CfgI18N cfgI18N2 = _cfgI18Ns[i]; string value = cfgI18N2.SectionEN?.Replace(" ", ""); string value2 = cfgI18N2.SectionCN?.Replace(" ", ""); if ((!string.IsNullOrEmpty(value) && text.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0) || (!string.IsNullOrEmpty(value2) && text.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0)) { cfgI18N = cfgI18N2; break; } } if (cfgI18N != null) { RegisterOneLiveLabel(uiElement, cfgI18N, isSection: true); return; } string key = label.Trim(); if (!_cfgByKeyOnly.TryGetValue(key, out var value3) || value3 == null || value3.Count == 0) { return; } if (value3.Count == 1) { RegisterOneLiveLabel(uiElement, value3[0], isSection: false); return; } if (!_pendingKeyMatchIndex.TryGetValue(key, out var value4)) { value4 = 0; } if (value4 >= value3.Count) { value4 = 0; } RegisterOneLiveLabel(uiElement, value3[value4], isSection: false); _pendingKeyMatchIndex[key] = value4 + 1; } private static void RegisterOneLiveLabel(object uiElement, CfgI18N i18n, bool isSection) { if (!IsOwnEntry(i18n) || !IsRenderingOurMod()) { return; } TextMeshProUGUI labelTmp = GetLabelTmp(uiElement); if ((Object)(object)labelTmp == (Object)null) { return; } bool flag = UseChinese(); string text = ((!isSection) ? (flag ? i18n.KeyCN : (i18n.DisplayEN ?? i18n.KeyEN)) : (flag ? i18n.SectionCN : i18n.SectionEN)); if (!string.IsNullOrEmpty(text)) { try { ((TMP_Text)labelTmp).text = text; } catch { } } _liveLabels.Add(new LiveLabel { Tmp = new WeakReference(labelTmp), I18N = i18n, IsSection = isSection }); if (!isSection && i18n.ReadOnlyEntry != null) { Object val = (Object)((uiElement is Object) ? uiElement : null); if (val != null && AccessTools.Field(uiElement.GetType(), "inputStringSystem") != null) { _liveValues.Add(new LiveValue { InputField = new WeakReference(val), I18N = i18n }); TrySetInputFieldValue(val, flag ? i18n.ValueCN : i18n.ValueEN); } } if (!isSection) { Type type = uiElement.GetType(); if (!_toggleLeftTmpCache.TryGetValue(type, out var value)) { value = AccessTools.Field(type, "leftButtonTMP"); _toggleLeftTmpCache[type] = value; } if (!_toggleRightTmpCache.TryGetValue(type, out var value2)) { value2 = AccessTools.Field(type, "rightButtonTMP"); _toggleRightTmpCache[type] = value2; } if (value != null && value2 != null) { object? value3 = value.GetValue(uiElement); TextMeshProUGUI val2 = (TextMeshProUGUI)((value3 is TextMeshProUGUI) ? value3 : null); object? value4 = value2.GetValue(uiElement); TextMeshProUGUI val3 = (TextMeshProUGUI)((value4 is TextMeshProUGUI) ? value4 : null); if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null) { _liveToggleButtons.Add(new LiveToggleButtons { LeftTmp = new WeakReference(val2), RightTmp = new WeakReference(val3) }); ApplyToggleButtonText(val2, val3, flag); } } } if (isSection || i18n.Entry == null || !i18n.Entry.SettingType.IsSubclassOf(typeof(Enum))) { return; } Object val4 = (Object)((uiElement is Object) ? uiElement : null); if (val4 != null) { Type type2 = uiElement.GetType(); if (!_sliderStringOptionsPropCache.TryGetValue(type2, out var value5)) { value5 = AccessTools.Property(type2, "stringOptions"); _sliderStringOptionsPropCache[type2] = value5; } if (value5 != null) { string[] names = Enum.GetNames(i18n.Entry.SettingType); string[] array = BuildEnumOptionsCN(names); string[] array2 = BuildEnumOptionsEN(names); LiveSliderOptions item = new LiveSliderOptions { Slider = new WeakReference(val4), I18N = i18n, OptionsCN = array, OptionsEN = array2 }; _liveSliderOptions.Add(item); TrySetSliderOptions(val4, value5, flag ? array : array2); } } } private static bool IsOwnEntry(CfgI18N i18n) { if (i18n?.Entry == null) { return false; } Plugin instance = Instance; if ((Object)(object)instance == (Object)null) { return false; } return i18n.Entry.ConfigFile == ((BaseUnityPlugin)instance).Config; } private static bool IsRenderingOurMod() { if (!_createModEntriesPatchInstalled) { return true; } if (_currentRenderingConfigFilePath == null) { return false; } Plugin instance = Instance; if ((Object)(object)instance == (Object)null) { return false; } return string.Equals(_currentRenderingConfigFilePath, ((BaseUnityPlugin)instance).Config.ConfigFilePath, StringComparison.OrdinalIgnoreCase); } private static TextMeshProUGUI GetLabelTmp(object uiElement) { try { Type type = uiElement.GetType(); if (!_labelTmpFieldCache.TryGetValue(type, out var value)) { value = AccessTools.Field(type, "labelTMP"); _labelTmpFieldCache[type] = value; } return (TextMeshProUGUI)((value == null) ? null : /*isinst with value type is only supported in some contexts*/); } catch { return null; } } internal static void RefreshLiveLabels() { bool flag = UseChinese(); for (int num = _liveLabels.Count - 1; num >= 0; num--) { LiveLabel liveLabel = _liveLabels[num]; if (!liveLabel.Tmp.TryGetTarget(out var target) || (Object)(object)target == (Object)null || (Object)(object)((Component)target).gameObject == (Object)null) { _liveLabels.RemoveAt(num); } else { string text = ((!liveLabel.IsSection) ? (flag ? liveLabel.I18N.KeyCN : (liveLabel.I18N.DisplayEN ?? liveLabel.I18N.KeyEN)) : (flag ? liveLabel.I18N.SectionCN : liveLabel.I18N.SectionEN)); try { ((TMP_Text)target).text = text; } catch { _liveLabels.RemoveAt(num); } } } for (int num2 = _liveValues.Count - 1; num2 >= 0; num2--) { LiveValue liveValue = _liveValues[num2]; if (!liveValue.InputField.TryGetTarget(out var target2) || target2 == (Object)null) { _liveValues.RemoveAt(num2); } else { string newVal = (flag ? liveValue.I18N.ValueCN : liveValue.I18N.ValueEN); if (!TrySetInputFieldValue(target2, newVal)) { _liveValues.RemoveAt(num2); } } } for (int num3 = _liveSliderOptions.Count - 1; num3 >= 0; num3--) { LiveSliderOptions liveSliderOptions = _liveSliderOptions[num3]; if (!liveSliderOptions.Slider.TryGetTarget(out var target3) || target3 == (Object)null) { _liveSliderOptions.RemoveAt(num3); } else { Type type = ((object)target3).GetType(); if (!_sliderStringOptionsPropCache.TryGetValue(type, out var value) || value == null) { _liveSliderOptions.RemoveAt(num3); } else { TrySetSliderOptions(target3, value, flag ? liveSliderOptions.OptionsCN : liveSliderOptions.OptionsEN); } } } for (int num4 = _liveToggleButtons.Count - 1; num4 >= 0; num4--) { LiveToggleButtons liveToggleButtons = _liveToggleButtons[num4]; if (!liveToggleButtons.LeftTmp.TryGetTarget(out var target4) || (Object)(object)target4 == (Object)null || !liveToggleButtons.RightTmp.TryGetTarget(out var target5) || (Object)(object)target5 == (Object)null) { _liveToggleButtons.RemoveAt(num4); } else { ApplyToggleButtonText(target4, target5, flag); } } _pendingKeyMatchIndex.Clear(); } private static string[] BuildEnumOptionsCN(string[] enumNames) { string[] array = new string[enumNames.Length]; for (int i = 0; i < enumNames.Length; i++) { array[i] = (_enumNameENtoCN.TryGetValue(enumNames[i], out var value) ? value : enumNames[i]); } return array; } private static string[] BuildEnumOptionsEN(string[] enumNames) { string[] array = new string[enumNames.Length]; for (int i = 0; i < enumNames.Length; i++) { array[i] = (_enumNameCNtoEN.TryGetValue(enumNames[i], out var value) ? value : enumNames[i]); } return array; } private static void TrySetSliderOptions(Object sliderObj, PropertyInfo prop, string[] options) { try { prop.SetValue(sliderObj, options); } catch { } } private static void ApplyToggleButtonText(TextMeshProUGUI leftTmp, TextMeshProUGUI rightTmp, bool cn) { try { ((TMP_Text)leftTmp).text = (cn ? "开" : "ON"); ((TMP_Text)rightTmp).text = (cn ? "关" : "OFF"); } catch { } } private static bool TrySetInputFieldValue(Object ifObj, string newVal) { try { Type type = ((object)ifObj).GetType(); if (!_inputStringSystemFieldCache.TryGetValue(type, out var value)) { value = AccessTools.Field(type, "inputStringSystem"); _inputStringSystemFieldCache[type] = value; } if (value == null) { return false; } object value2 = value.GetValue(ifObj); if (value2 == null) { return false; } Type type2 = value2.GetType(); if (!_inputStringSystemSetValueCache.TryGetValue(type2, out var value3)) { value3 = AccessTools.Method(type2, "SetValue", new Type[2] { typeof(string), typeof(bool) }, (Type[])null); _inputStringSystemSetValueCache[type2] = value3; } if (value3 == null) { return false; } value3.Invoke(value2, new object[2] { newVal ?? string.Empty, false }); return true; } catch { return false; } } } public class SpawnedByGameToolsHelper : MonoBehaviour { } internal sealed class ConfigurationManagerAttributes { public int? Order; public bool? ReadOnly; public bool? Browsable; public bool? HideDefaultButton; public string Category; public string DispName; public string Description; } public static class DictionaryExtensions { public static int GetValueOrDefault(this Dictionary dict, string key, int defaultValue = 0) { if (dict != null && key != null && dict.TryGetValue(key, out var value)) { return value; } return defaultValue; } } [HarmonyPatch(typeof(EnemyDirector), "AddEnemyValuable")] public static class EnemyDirector_AddEnemyValuable_Patch { [HarmonyPrefix] public static bool Prefix(EnemyDirector __instance, EnemyValuable _newValuable) { if (Plugin.IsRemovePillarLimitEnabled()) { List list = Plugin.EnemyDirectorEnemyValuablesRef.Invoke(__instance); if (list != null) { List list2 = new List(); foreach (EnemyValuable item in list) { if (!Object.op_Implicit((Object)(object)item)) { list2.Add(item); } } foreach (EnemyValuable item2 in list2) { list.Remove(item2); } list.Add(_newValuable); } return false; } return true; } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class EnemyParent_Despawn_Patch { [HarmonyPrefix] public static bool Prefix(EnemyParent __instance) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Invalid comparison between Unknown and I4 //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //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_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_016c: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.IsStaticModEnabled()) { return true; } Enemy val = Plugin.EnemyParentEnemyRef.Invoke(__instance); if ((Object)(object)val == (Object)null) { return true; } bool num = Plugin.EnemyHasHealthRef.Invoke(val); EnemyHealth val2 = Plugin.EnemyHealthRef.Invoke(val); if (!num || (Object)(object)val2 == (Object)null || Plugin.EnemyHealthCurrentRef.Invoke(val2) > 0) { return true; } bool flag = Plugin.IsRemovePillarLimitEnabled(); bool flag2 = Plugin.IsPillarDropMultiplierEnabled(); int pillarDropMultiplier = Plugin.GetPillarDropMultiplier(); if (flag || flag2) { bool flag3 = val2.spawnValuable && Plugin.EnemyParentValuableSpawnTimerRef.Invoke(__instance) > 0f && Plugin.EnemyHealthSpawnValuableCurrentRef.Invoke(val2) < val2.spawnValuableMax; if (flag ? (Plugin.EnemyParentValuableSpawnTimerRef.Invoke(__instance) > 0f) : flag3) { GameObject val3 = AssetManager.instance.enemyValuableSmall; if ((int)__instance.difficulty == 1) { val3 = AssetManager.instance.enemyValuableMedium; } else if ((int)__instance.difficulty == 2) { val3 = AssetManager.instance.enemyValuableBig; } Transform val4 = val.CustomValuableSpawnTransform; if (!Object.op_Implicit((Object)(object)val4)) { val4 = val.CenterTransform; } if ((Object)(object)val3 != (Object)null && (Object)(object)val4 != (Object)null) { int num2 = ((!flag2) ? 1 : pillarDropMultiplier); if (SemiFunc.IsMasterClientOrSingleplayer()) { for (int i = 0; i < num2; i++) { Vector3 val5 = val4.position; if (i > 0) { Vector3 val6 = Random.insideUnitSphere * 0.2f; val6.y = Mathf.Abs(val6.y) * 0.1f; val5 += val6; } if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(val3, val5, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)val3).name, val5, Quaternion.identity, (byte)0, (object[])null); } } } Plugin.EnemyHealthSpawnValuableCurrentRef.Invoke(val2) += num2; } Plugin.EnemyParentValuableSpawnTimerRef.Invoke(__instance) = 0f; } } return true; } } [HarmonyPatch(typeof(CosmeticWorldObject), "ExtractRPC")] internal class CosmeticWorldObject_ExtractRPC_Patch { [HarmonyPrefix] private static bool Prefix(CosmeticWorldObject __instance, PhotonMessageInfo _info) { //IL_002a: 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_008a: 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_00b7: Unknown result type (might be due to invalid IL or missing references) if (Plugin._cfgModEnabled == null || !Plugin._cfgModEnabled.Value) { return true; } if (Plugin._cfgLimitCosmeticBoxes == null || !Plugin._cfgLimitCosmeticBoxes.Value) { return true; } if (!SemiFunc.MasterOnlyRPC(_info) || !Plugin.CosmeticWorldObjectInExtractionRef.Invoke(__instance)) { return false; } int count = Plugin.RoundDirectorCosmeticWorldObjectsExtractedRef.Invoke(RoundDirector.instance).Count; int cosmeticBoxesLimit = Plugin.GetCosmeticBoxesLimit(); if (cosmeticBoxesLimit <= 10) { if (count >= cosmeticBoxesLimit) { return false; } CosmeticWorldObjectUI.instance.Add(__instance.rarity); Plugin.RoundDirectorCosmeticWorldObjectsExtractedRef.Invoke(RoundDirector.instance).Add(__instance.rarity); return false; } CosmeticWorldObjectUI.instance.Add(__instance.rarity); Plugin.RoundDirectorCosmeticWorldObjectsExtractedRef.Invoke(RoundDirector.instance).Add(__instance.rarity); return false; } } [HarmonyPatch(typeof(SemiFunc), "MasterOnlyRPC")] internal class SemiFunc_MasterOnlyRPC_Patch { [HarmonyPrefix] private static bool Prefix(PhotonMessageInfo _info, ref bool __result) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.IsStaticModEnabled()) { return true; } if (PhotonNetwork.LocalPlayer != null && _info.Sender == PhotonNetwork.LocalPlayer) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(PlayerDeathHead), "Trigger")] internal class PlayerDeathHead_Trigger_Patch { private static readonly FieldInfo _fTriggeredPosition = AccessTools.Field(typeof(PlayerDeathHead), "triggeredPosition"); [HarmonyPostfix] private static void Postfix(PlayerDeathHead __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.IsStaticModEnabled()) { return; } if (Plugin.IsDeathAutoToTruck()) { Vector3 truckPosition = Plugin.GetTruckPosition(); if (truckPosition != Vector3.zero) { _fTriggeredPosition?.SetValue(__instance, truckPosition); } } else if (Plugin.IsDeathAutoToExtraction()) { Vector3 anyExtractionPointPosition = Plugin.GetAnyExtractionPointPosition(); if (anyExtractionPointPosition != Vector3.zero) { _fTriggeredPosition?.SetValue(__instance, anyExtractionPointPosition); } } if (!Plugin.IsTeammateDeathDropBeadEnabled() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { GameObject enemyValuableSmall = AssetManager.instance.enemyValuableSmall; if ((Object)(object)enemyValuableSmall != (Object)null) { Vector3 position = ((Component)__instance).transform.position; if ((Object)(object)__instance.playerAvatar != (Object)null) { position = ((Component)__instance.playerAvatar).transform.position; } if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(enemyValuableSmall, position, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)enemyValuableSmall).name, position, Quaternion.identity, (byte)0, (object[])null); } Plugin.LogInfo($"[GameTools] Teammate dead head triggered. Dropped a small valuable shard at {position}."); } } catch (Exception arg) { Plugin.LogWarning($"[TeammateDeathDropBead Error]: {arg}"); } } } [HarmonyPatch(typeof(ChargingStation))] internal class ChargingStation_Patch { private static readonly FieldRef _fChargeIntRef = AccessTools.FieldRefAccess("chargeInt"); private static readonly FieldRef _fChargeTotalRef = AccessTools.FieldRefAccess("chargeTotal"); private static readonly FieldRef _fChargeFloatRef = AccessTools.FieldRefAccess("chargeFloat"); private static readonly FieldRef _fChargeSegmentCurrentRef = AccessTools.FieldRefAccess("chargeSegmentCurrent"); [HarmonyPrefix] [HarmonyPatch("Update")] private static void Update_Prefix(ChargingStation __instance) { if (Plugin.IsStaticModEnabled()) { if (Plugin.IsInfiniteChargingStationEnabled()) { _fChargeIntRef.Invoke(__instance) = 10; _fChargeTotalRef.Invoke(__instance) = 100; _fChargeFloatRef.Invoke(__instance) = 1f; _fChargeSegmentCurrentRef.Invoke(__instance) = __instance.chargeSegments; } if (Plugin.IsChargingStationHealEnabled()) { Plugin.AccumulateChargingStationHeal(Time.deltaTime, __instance); } } } [HarmonyPrefix] [HarmonyPatch("OutOfCrystalsShutdown")] private static bool OutOfCrystalsShutdown_Prefix() { if (Plugin.IsStaticModEnabled() && Plugin.IsInfiniteChargingStationEnabled()) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch("ChargingStationCrystalBrokenRPC")] private static bool ChargingStationCrystalBrokenRPC_Prefix() { if (Plugin.IsStaticModEnabled() && Plugin.IsInfiniteChargingStationEnabled()) { return false; } return true; } } [HarmonyPatch(typeof(PunManager))] internal class UpgradeLimit_Patches { [HarmonyPrefix] [HarmonyPatch("UpgradePlayerCrouchRest")] private static bool Prefix_CrouchRest(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("CrouchRest", _steamID); if (Plugin.IsUpgradeLimitActiveFor("CrouchRest", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradeDeathHeadBattery")] private static bool Prefix_DeathHeadBattery(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("DeathHeadBattery", _steamID); if (Plugin.IsUpgradeLimitActiveFor("DeathHeadBattery", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerExtraJump")] private static bool Prefix_ExtraJump(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("ExtraJump", _steamID); if (Plugin.IsUpgradeLimitActiveFor("ExtraJump", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerHealth")] private static bool Prefix_Health(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Health", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Health", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerTumbleLaunch")] private static bool Prefix_Launch(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Launch", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Launch", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradeMapPlayerCount")] private static bool Prefix_MapPlayerCount(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("MapPlayerCount", _steamID); if (Plugin.IsUpgradeLimitActiveFor("MapPlayerCount", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerGrabRange")] private static bool Prefix_Range(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Range", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Range", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerSprintSpeed")] private static bool Prefix_Speed(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Speed", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Speed", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerEnergy")] private static bool Prefix_Stamina(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Stamina", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Stamina", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerGrabStrength")] private static bool Prefix_Strength(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Strength", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Strength", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerThrowStrength")] private static bool Prefix_Throw(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("Throw", _steamID); if (Plugin.IsUpgradeLimitActiveFor("Throw", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerTumbleClimb")] private static bool Prefix_TumbleClimb(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("TumbleClimb", _steamID); if (Plugin.IsUpgradeLimitActiveFor("TumbleClimb", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } [HarmonyPrefix] [HarmonyPatch("UpgradePlayerTumbleWings")] private static bool Prefix_TumbleWings(string _steamID, int value, ref int __result) { if (Plugin.IsStaticModEnabled()) { int upgradeLevelFromGame = Plugin.GetUpgradeLevelFromGame("TumbleWings", _steamID); if (Plugin.IsUpgradeLimitActiveFor("TumbleWings", _steamID, upgradeLevelFromGame, value)) { __result = upgradeLevelFromGame; return false; } } return true; } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Update")] internal class PlayerAvatarVisuals_Update_Patch { private static readonly MethodInfo _applyLocalVisibilityMethod = typeof(PlayerAvatarVisuals).GetMethod("ApplyLocalVisibility", BindingFlags.Instance | BindingFlags.NonPublic); private static float _nextSyncTime = 0f; [HarmonyPrefix] private static void Prefix(PlayerAvatarVisuals __instance) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null && Time.time > _nextSyncTime) { _nextSyncTime = Time.time + 5f; Plugin.SyncSpinConfigsToNetwork(); } if ((Plugin._cfgModEnabled == null || !Plugin._cfgModEnabled.Value) && !Plugin.IsCosmeticsEnabled()) { return; } try { if (__instance.isMenuAvatar || !((Object)(object)__instance.playerAvatar != (Object)null)) { return; } PlayerSpinSyncHelper playerSpinSyncHelper = ((Component)__instance.playerAvatar).gameObject.GetComponent(); if ((Object)(object)playerSpinSyncHelper == (Object)null) { playerSpinSyncHelper = ((Component)__instance.playerAvatar).gameObject.AddComponent(); } if (playerSpinSyncHelper.wasVisualsModified) { Transform transform = ((Component)__instance).transform; float num = playerSpinSyncHelper.localOrigPosY; if (Mathf.Abs(num) > 2f) { num = 0f; } transform.localPosition = new Vector3(0f, num, 0f); transform.localRotation = Quaternion.identity; } if (playerSpinSyncHelper.localOrigPosY == 0f) { float y = ((Component)__instance).transform.localPosition.y; if (y < -0.1f && y > -2f) { playerSpinSyncHelper.localOrigPosY = y; } else { playerSpinSyncHelper.localOrigPosY = -0.85f; } } } catch (Exception arg) { Plugin.LogWarning($"[PlayerAvatarVisuals.Update Prefix Error]: {arg}"); } } [HarmonyPostfix] private static void Postfix(PlayerAvatarVisuals __instance) { if ((Plugin._cfgModEnabled == null || !Plugin._cfgModEnabled.Value) && !Plugin.IsCosmeticsEnabled()) { return; } try { if (__instance.isMenuAvatar || !((Object)(object)__instance.playerAvatar != (Object)null)) { return; } if (Plugin.PlayerAvatarIsLocalRef.Invoke(__instance.playerAvatar) && Plugin.IsThirdPersonEnabled()) { __instance.ShowSelfOverride(0.5f); if ((Object)(object)__instance.meshParent != (Object)null && !__instance.meshParent.activeSelf) { __instance.meshParent.SetActive(true); } _applyLocalVisibilityMethod?.Invoke(__instance, new object[1] { (object)(ShadowCastingMode)1 }); } GameToolsVisuals.ApplyFlipAndSpinVisuals(__instance.playerAvatar); } catch (Exception arg) { Plugin.LogWarning($"[PlayerAvatarVisuals.Update Postfix Error]: {arg}"); } } } public class PlayerSpinSyncHelper : MonoBehaviour { public float localOrigPosY; public float lastModifiedHeight = -9999f; public bool wasVisualsModified; public double frozenTime = -1.0; public bool hasRpcData; public bool rpcFlip; public bool rpcSpin; public int rpcSpinAxis = 1; public int rpcSpinDirection = 1; public float rpcSpinSpeed = 1f; public bool rpcSpinFreeze; public double rpcFrozenTime = -1.0; public float rpcSpinRadius; public void Reset() { wasVisualsModified = false; frozenTime = -1.0; lastModifiedHeight = -9999f; hasRpcData = false; } } public static class GameToolsVisuals { public const float FLIP_HEIGHT = 1.42f; public static void ResetLocalState() { //IL_008f: 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) if (!((Object)(object)PlayerController.instance != (Object)null) || !((Object)(object)PlayerController.instance.playerAvatar != (Object)null)) { return; } GameObject playerAvatar = PlayerController.instance.playerAvatar; PlayerSpinSyncHelper component = playerAvatar.GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } PlayerAvatar component2 = playerAvatar.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.playerAvatarVisuals != (Object)null) { Transform transform = ((Component)component2.playerAvatarVisuals).transform; float num = component.localOrigPosY; if (Mathf.Abs(num) > 2f) { num = 0f; } transform.localPosition = new Vector3(0f, num, 0f); transform.localRotation = Quaternion.identity; } component.Reset(); } public static double GetFrozenTime() { if ((Object)(object)PlayerController.instance != (Object)null && (Object)(object)PlayerController.instance.playerAvatar != (Object)null) { PlayerSpinSyncHelper component = PlayerController.instance.playerAvatar.GetComponent(); if ((Object)(object)component != (Object)null) { return component.frozenTime; } } return -1.0; } public static void ApplyFlipAndSpinVisuals(PlayerAvatar avatar) { //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0772: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0791: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0b2a: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0b9e: Unknown result type (might be due to invalid IL or missing references) //IL_0ba1: Unknown result type (might be due to invalid IL or missing references) //IL_0ba3: Unknown result type (might be due to invalid IL or missing references) //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) //IL_0baa: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0bb6: Unknown result type (might be due to invalid IL or missing references) //IL_0bb8: Unknown result type (might be due to invalid IL or missing references) //IL_0bba: Unknown result type (might be due to invalid IL or missing references) //IL_0bbf: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0beb: Unknown result type (might be due to invalid IL or missing references) //IL_0c14: Unknown result type (might be due to invalid IL or missing references) //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0c07: Unknown result type (might be due to invalid IL or missing references) //IL_0c0c: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_09d8: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_0a1c: Unknown result type (might be due to invalid IL or missing references) //IL_0a21: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0a85: Unknown result type (might be due to invalid IL or missing references) //IL_0ac8: Unknown result type (might be due to invalid IL or missing references) //IL_0acd: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b13: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0b28: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Unknown result type (might be due to invalid IL or missing references) //IL_0c6d: Unknown result type (might be due to invalid IL or missing references) //IL_0c7d: Unknown result type (might be due to invalid IL or missing references) //IL_0c82: Unknown result type (might be due to invalid IL or missing references) //IL_0c87: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null || (Object)(object)avatar.playerAvatarVisuals == (Object)null || !Plugin.PlayerAvatarIsLocalRef.Invoke(avatar)) { return; } PlayerSpinSyncHelper playerSpinSyncHelper = ((Component)avatar).GetComponent(); if ((Object)(object)playerSpinSyncHelper == (Object)null) { playerSpinSyncHelper = ((Component)avatar).gameObject.AddComponent(); } bool flag = true; Transform transform = ((Component)avatar.playerAvatarVisuals).transform; bool flag2 = false; bool flag3 = false; int num = 1; int num2 = 1; float num3 = 1f; bool flag4 = false; double num4 = -1.0; float num5 = 0f; if (flag) { flag2 = Plugin.IsFlipEnabled(); flag3 = Plugin.IsSpinEnabled(); num = ((Plugin._cfgSpinAxis == null) ? 1 : Plugin._cfgSpinAxis.Value); num2 = ((Plugin._cfgSpinDirection == null) ? 1 : Plugin._cfgSpinDirection.Value); num3 = Plugin.GetSpinSpeed(); flag4 = Plugin.IsSpinFreeze(); num4 = playerSpinSyncHelper.frozenTime; num5 = Plugin.GetSpinRadius(); } else if (playerSpinSyncHelper.hasRpcData) { flag2 = playerSpinSyncHelper.rpcFlip; flag3 = playerSpinSyncHelper.rpcSpin; num = playerSpinSyncHelper.rpcSpinAxis; num2 = playerSpinSyncHelper.rpcSpinDirection; num3 = playerSpinSyncHelper.rpcSpinSpeed; flag4 = playerSpinSyncHelper.rpcSpinFreeze; num4 = playerSpinSyncHelper.rpcFrozenTime; num5 = playerSpinSyncHelper.rpcSpinRadius; } else { string text = Plugin.PlayerAvatarSteamIDRef.Invoke(avatar); string text2 = Plugin.PlayerAvatarPlayerNameRef.Invoke(avatar); Hashtable val = null; if (val == null && PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null && !string.IsNullOrEmpty(text)) { Hashtable customProperties = ((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties; if (((Dictionary)(object)customProperties).ContainsKey((object)("GT_FlipEnabled_" + text))) { val = new Hashtable(); val[(object)"GT_FlipEnabled"] = customProperties[(object)("GT_FlipEnabled_" + text)]; if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinEnabled_" + text), out object value)) { val[(object)"GT_SpinEnabled"] = value; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinAxis_" + text), out object value2)) { val[(object)"GT_SpinAxis"] = value2; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinDirection_" + text), out object value3)) { val[(object)"GT_SpinDirection"] = value3; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinSpeed_" + text), out object value4)) { val[(object)"GT_SpinSpeed"] = value4; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinFreeze_" + text), out object value5)) { val[(object)"GT_SpinFreeze"] = value5; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_FrozenTime_" + text), out object value6)) { val[(object)"GT_FrozenTime"] = value6; } if (((Dictionary)(object)customProperties).TryGetValue((object)("GT_SpinRadius_" + text), out object value7)) { val[(object)"GT_SpinRadius"] = value7; } } } if (val == null && (Object)(object)avatar.photonView != (Object)null && avatar.photonView.Controller != null) { Hashtable customProperties2 = avatar.photonView.Controller.CustomProperties; if (((Dictionary)(object)customProperties2).ContainsKey((object)"GT_FlipEnabled") || ((Dictionary)(object)customProperties2).ContainsKey((object)"GT_SpinEnabled")) { val = customProperties2; } } if (val == null && (Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) { Hashtable customProperties3 = avatar.photonView.Owner.CustomProperties; if (((Dictionary)(object)customProperties3).ContainsKey((object)"GT_FlipEnabled") || ((Dictionary)(object)customProperties3).ContainsKey((object)"GT_SpinEnabled")) { val = customProperties3; } } if (val == null && PhotonNetwork.InRoom) { Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val2 in playerList) { if (val2 != null) { bool flag5 = false; if (!string.IsNullOrEmpty(text) && val2.UserId == text) { flag5 = true; } else if (!string.IsNullOrEmpty(text2) && val2.NickName == text2) { flag5 = true; } if (flag5 && (((Dictionary)(object)val2.CustomProperties).ContainsKey((object)"GT_FlipEnabled") || ((Dictionary)(object)val2.CustomProperties).ContainsKey((object)"GT_SpinEnabled"))) { val = val2.CustomProperties; break; } } } } if (val == null && (Object)(object)avatar.photonView != (Object)null) { int num6 = avatar.photonView.ViewID / 1000; if (num6 > 0 && PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null) { Player player = PhotonNetwork.CurrentRoom.GetPlayer(num6, false); if (player != null && (((Dictionary)(object)player.CustomProperties).ContainsKey((object)"GT_FlipEnabled") || ((Dictionary)(object)player.CustomProperties).ContainsKey((object)"GT_SpinEnabled"))) { val = player.CustomProperties; } } } if (val != null) { if (((Dictionary)(object)val).TryGetValue((object)"GT_FlipEnabled", out object value8)) { try { flag2 = Convert.ToBoolean(value8); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinEnabled", out object value9)) { try { flag3 = Convert.ToBoolean(value9); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinAxis", out object value10)) { try { num = Convert.ToInt32(value10); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinDirection", out object value11)) { try { num2 = Convert.ToInt32(value11); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinSpeed", out object value12)) { try { num3 = Convert.ToSingle(value12); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinFreeze", out object value13)) { try { flag4 = Convert.ToBoolean(value13); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_FrozenTime", out object value14)) { try { num4 = Convert.ToDouble(value14); } catch { } } if (((Dictionary)(object)val).TryGetValue((object)"GT_SpinRadius", out object value15)) { try { num5 = Convert.ToSingle(value15); } catch { } } Plugin.LogInfo($"[RemoteSync Debug]: Player={text2}, viewID={avatar.photonView.ViewID}, isFlip={flag2}, isSpin={flag3}, spinAxis={num}, speed={num3}"); } else { Plugin.LogInfo("[RemoteSync Debug Fail]: Player=" + text2 + ", viewID=" + (((Object)(object)avatar.photonView != (Object)null) ? avatar.photonView.ViewID.ToString() : "null") + ", Owner=" + (((Object)(object)avatar.photonView != (Object)null && avatar.photonView.Owner != null) ? avatar.photonView.Owner.NickName : "null") + ", props is null"); } } float num7 = ((flag && Plugin.IsThirdPersonEnabled()) ? Plugin.GetThirdPersonModelScale() : 1f); bool flag6 = false; bool flag7 = false; flag6 = flag2 && Plugin.IsThirdPersonEnabled() && Plugin.IsFlipShowToSelf(); flag7 = flag3 && Plugin.IsThirdPersonEnabled() && Plugin.IsSpinShowToSelf(); PlayerTumble val3 = Plugin.PlayerAvatarTumbleRef.Invoke(avatar); if ((Object)(object)val3 != (Object)null && Plugin.PlayerTumbleIsTumblingRef.Invoke(val3)) { if (playerSpinSyncHelper.wasVisualsModified) { transform.localPosition = new Vector3(0f, playerSpinSyncHelper.localOrigPosY, 0f); transform.localRotation = Quaternion.identity; playerSpinSyncHelper.wasVisualsModified = false; } return; } if (!flag6 && !flag7) { if (playerSpinSyncHelper.wasVisualsModified) { transform.localPosition = new Vector3(0f, playerSpinSyncHelper.localOrigPosY, 0f); transform.localRotation = Quaternion.identity; playerSpinSyncHelper.wasVisualsModified = false; } transform.localScale = new Vector3(num7, num7, num7); return; } playerSpinSyncHelper.wasVisualsModified = true; transform.localScale = new Vector3(num7, num7, num7); Quaternion val4 = Quaternion.identity; if (flag6) { val4 = Quaternion.Euler(0f, 0f, 180f); } Quaternion val5 = Quaternion.identity; float num8 = 0f; double num9 = (PhotonNetwork.InRoom ? PhotonNetwork.Time : ((double)Time.time)); if (flag3) { if (flag4) { if (flag) { if (playerSpinSyncHelper.frozenTime < 0.0) { playerSpinSyncHelper.frozenTime = num9; Plugin.SyncSpinConfigsToNetwork(); } num9 = playerSpinSyncHelper.frozenTime; } else if (num4 > 0.0) { num9 = num4; } } else if (flag) { playerSpinSyncHelper.frozenTime = -1.0; } } if (flag7) { float num10 = ((num2 == 2) ? (-1f) : 1f); float num11 = (float)(num9 * (double)num3 * 360.0 % 360.0) * num10; switch (num) { case 1: val5 = Quaternion.Euler(0f, num11, 0f); break; case 2: val5 = Quaternion.Euler(num11, 0f, 0f); break; case 3: val5 = Quaternion.Euler(0f, 0f, num11); break; case 4: val5 = Quaternion.Euler(num11 * 2f, num11, 0f); break; case 5: val5 = Quaternion.Euler(0f, num11, 0f); num8 = Mathf.Sin((float)num9 * 5f) * 0.4f; break; case 6: { float num15 = (float)num9 * 3f; val5 = Quaternion.Euler(new Vector3(Mathf.Cos(num15), 0f, Mathf.Sin(num15)) * 15f) * Quaternion.Euler(0f, num11, 0f); break; } case 7: val5 = Quaternion.Euler(30f, 0f, 0f) * Quaternion.Euler(0f, num11, 0f); break; case 8: { float num14 = Mathf.Sin((float)num9 * 2.5f) * 30f; val5 = Quaternion.Euler(num14, num11, num14); break; } case 9: val5 = Quaternion.Euler(0f, num11, 0f); num8 = Mathf.Sin((float)num9 * 10f) * 0.3f; break; case 10: { float num13 = Mathf.Sin((float)num9 * 8f) * 45f; val5 = Quaternion.Euler(0f, 0f, num13); break; } case 11: val5 = Quaternion.Euler(num11, 0f, 0f); num8 = Mathf.Sin((float)num9 * 3f) * 0.6f; break; case 12: { float num12 = (float)num9 * 2f; val5 = Quaternion.Euler(Mathf.Sin(num12) * 35f, 0f, Mathf.Cos(num12) * 35f); break; } case 13: val5 = Quaternion.Euler((Mathf.Sin((float)(num9 * (double)num3 * 2.0 * 3.1415927410125732)) + 1f) * 0.5f * 45f, 0f, 0f); break; case 14: val5 = Quaternion.Euler((0f - (Mathf.Sin((float)(num9 * (double)num3 * 2.0 * 3.1415927410125732)) + 1f)) * 0.5f * 45f, 0f, 0f); break; case 15: val5 = Quaternion.Euler(90f, num11, 0f); break; } } Vector3 zero = Vector3.zero; if (flag7 && num5 > 0.05f) { float num16 = ((num2 == 2) ? (-1f) : 1f); float num17 = num5; float num18 = (float)(num9 * (double)num3 * 2.0 * 3.1415927410125732) * num16; float num19 = Mathf.Cos(num18) * num17; float num20 = Mathf.Sin(num18) * num17; ((Vector3)(ref zero))..ctor(num19, 0f, num20); } Quaternion localRotation = transform.localRotation; transform.localRotation = localRotation * val4 * val5; float y = (val4 * val5 * Vector3.up).y; float num21 = 0.71f * (1f - y); Vector3 position = ((Component)avatar).transform.position; if (flag && (Object)(object)PlayerController.instance != (Object)null) { position = ((Component)PlayerController.instance).transform.position; } Vector3 val6 = ((Component)avatar).transform.TransformDirection(zero); float num22 = 0f; if (!flag6) { num22 = (flag ? 0f : playerSpinSyncHelper.localOrigPosY); if (!flag && Mathf.Abs(num22) > 2f) { num22 = -0.85f; } } float num23 = num21; if (flag6) { num23 += 0.32f; } transform.position = position + ((Component)avatar).transform.up * (num22 + (num23 + num8) * num7) + val6; playerSpinSyncHelper.lastModifiedHeight = num22 + (num23 + num8) * num7; } } [HarmonyPatch(typeof(PlayerAvatar), "OnPhotonSerializeView")] internal class PlayerAvatar_OnPhotonSerializeView_Patch { private static readonly FieldRef f_isCrouching = AccessTools.FieldRefAccess("isCrouching"); private static readonly FieldRef f_isSprinting = AccessTools.FieldRefAccess("isSprinting"); private static readonly FieldRef f_isCrawling = AccessTools.FieldRefAccess("isCrawling"); private static readonly FieldRef f_isSliding = AccessTools.FieldRefAccess("isSliding"); private static readonly FieldRef f_isMoving = AccessTools.FieldRefAccess("isMoving"); private static readonly FieldRef f_isGrounded = AccessTools.FieldRefAccess("isGrounded"); private static readonly FieldRef f_Interact = AccessTools.FieldRefAccess("Interact"); private static readonly FieldRef f_InputDirectionRaw = AccessTools.FieldRefAccess("InputDirectionRaw"); private static readonly FieldRef f_rbVelocity = AccessTools.FieldRefAccess("rbVelocity"); private static readonly FieldRef f_rbVelocityRaw = AccessTools.FieldRefAccess("rbVelocityRaw"); private static readonly FieldRef f_rotationDisabled = AccessTools.FieldRefAccess("rotationDisabled"); private static readonly FieldRef f_rotationOverrideActive = AccessTools.FieldRefAccess("rotationOverrideActive"); private static readonly FieldRef f_playerPing = AccessTools.FieldRefAccess("playerPing"); [HarmonyPrefix] private static bool Prefix(PlayerAvatar __instance, PhotonStream stream, PhotonMessageInfo info) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) if ((Plugin._cfgModEnabled == null || !Plugin._cfgModEnabled.Value) && !Plugin.IsCosmeticsEnabled()) { return true; } PlayerTumble val = Plugin.PlayerAvatarTumbleRef.Invoke(__instance); if ((Object)(object)val != (Object)null && Plugin.PlayerTumbleIsTumblingRef.Invoke(val)) { return true; } bool flag = Plugin.IsFlipEnabled(); bool flag2 = Plugin.IsSpinEnabled(); if (!flag && !flag2) { return true; } if (!SemiFunc.MasterAndOwnerOnlyRPC(info, __instance.photonView)) { return false; } if (stream.IsWriting) { stream.SendNext((object)f_isCrouching.Invoke(__instance)); stream.SendNext((object)f_isSprinting.Invoke(__instance)); stream.SendNext((object)f_isCrawling.Invoke(__instance)); stream.SendNext((object)f_isSliding.Invoke(__instance)); stream.SendNext((object)f_isMoving.Invoke(__instance)); stream.SendNext((object)f_isGrounded.Invoke(__instance)); stream.SendNext((object)f_Interact.Invoke(__instance)); stream.SendNext((object)f_InputDirectionRaw.Invoke(__instance)); stream.SendNext((object)f_rbVelocity.Invoke(__instance)); stream.SendNext((object)f_rbVelocityRaw.Invoke(__instance)); Quaternion val2 = Quaternion.identity; if (flag) { val2 = Quaternion.Euler(0f, 0f, 180f); } Quaternion val3 = Quaternion.identity; float num = 0f; Vector3 zero = Vector3.zero; if (flag2) { int num2 = ((Plugin._cfgSpinDirection == null) ? 1 : Plugin._cfgSpinDirection.Value); int num3 = ((Plugin._cfgSpinAxis == null) ? 1 : Plugin._cfgSpinAxis.Value); float spinSpeed = Plugin.GetSpinSpeed(); float spinRadius = Plugin.GetSpinRadius(); float num4 = ((num2 == 2) ? (-1f) : 1f); double num5 = (PhotonNetwork.InRoom ? PhotonNetwork.Time : ((double)Time.time)); if (Plugin.IsSpinFreeze()) { PlayerSpinSyncHelper component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && component.frozenTime > 0.0) { num5 = component.frozenTime; } } float num6 = (float)(num5 * (double)spinSpeed * 360.0 % 360.0) * num4; switch (num3) { case 1: val3 = Quaternion.Euler(0f, num6, 0f); break; case 2: val3 = Quaternion.Euler(num6, 0f, 0f); break; case 3: val3 = Quaternion.Euler(0f, 0f, num6); break; case 4: val3 = Quaternion.Euler(num6 * 2f, num6, 0f); break; case 5: val3 = Quaternion.Euler(0f, num6, 0f); break; case 6: { float num10 = (float)num5 * 3f; val3 = Quaternion.Euler(new Vector3(Mathf.Cos(num10), 0f, Mathf.Sin(num10)) * 15f) * Quaternion.Euler(0f, num6, 0f); break; } case 7: val3 = Quaternion.Euler(30f, 0f, 0f) * Quaternion.Euler(0f, num6, 0f); break; case 8: { float num9 = Mathf.Sin((float)num5 * 2.5f) * 30f; val3 = Quaternion.Euler(num9, num6, num9); break; } case 9: val3 = Quaternion.Euler(0f, num6, 0f); break; case 10: { float num8 = Mathf.Sin((float)num5 * 8f) * 45f; val3 = Quaternion.Euler(0f, 0f, num8); break; } case 11: val3 = Quaternion.Euler(num6, 0f, 0f); break; case 12: { float num7 = (float)num5 * 2f; val3 = Quaternion.Euler(Mathf.Sin(num7) * 35f, 0f, Mathf.Cos(num7) * 35f); break; } case 13: val3 = Quaternion.Euler((Mathf.Sin((float)(num5 * (double)spinSpeed * 2.0 * 3.1415927410125732)) + 1f) * 0.5f * 45f, 0f, 0f); break; case 14: val3 = Quaternion.Euler((0f - (Mathf.Sin((float)(num5 * (double)spinSpeed * 2.0 * 3.1415927410125732)) + 1f)) * 0.5f * 45f, 0f, 0f); break; case 15: val3 = Quaternion.Euler(90f, num6, 0f); break; } if (spinRadius > 0.05f) { float num11 = spinRadius; if (num3 == 9) { float num12 = Mathf.Sin((float)(num5 * (double)spinSpeed * 2.0 * 3.1415927410125732)); num11 *= 0.6f - 0.4f * num12; } float num13 = (float)(num5 * (double)spinSpeed * 2.0 * 3.1415927410125732) * num4; float num14 = Mathf.Cos(num13) * num11; float num15 = Mathf.Sin(num13) * num11; ((Vector3)(ref zero))..ctor(num14, 0f, num15); } } float y = (val2 * val3 * Vector3.up).y; float num16 = (flag ? 0.32f : 0f); float num17 = 0.71f * (1f - y) + num + num16; Vector3 val4 = (((Object)(object)PlayerController.instance != (Object)null) ? ((Component)PlayerController.instance).transform.position : ((Component)__instance).transform.position); Vector3 val5 = ((Component)__instance).transform.TransformDirection(zero); val4 += ((Component)__instance).transform.up * num17 + val5; stream.SendNext((object)val4); Quaternion val6 = (((Object)(object)PlayerController.instance != (Object)null) ? ((Component)PlayerController.instance).transform.rotation : ((Component)__instance).transform.rotation); val6 = val6 * val2 * val3; stream.SendNext((object)val6); stream.SendNext((object)f_rotationDisabled.Invoke(__instance)); stream.SendNext((object)f_rotationOverrideActive.Invoke(__instance)); if ((Object)(object)PlayerController.instance != (Object)null && (Object)(object)PlayerController.instance.CollisionGrounded != (Object)null) { stream.SendNext((object)PlayerController.instance.CollisionGrounded.physRiding); stream.SendNext((object)PlayerController.instance.CollisionGrounded.physRidingID); stream.SendNext((object)PlayerController.instance.CollisionGrounded.physRidingPosition); } else { stream.SendNext((object)false); stream.SendNext((object)0); stream.SendNext((object)Vector3.zero); } stream.SendNext((object)false); stream.SendNext((object)f_playerPing.Invoke(__instance)); return false; } return true; } } internal static class REPOConfigCreateHook { public static void Postfix(object[] __args, object __result) { try { if (__args != null && __args.Length != 0 && __result != null && __args[0] is string label) { Plugin.RegisterLiveLabelIfMatched(label, __result); } } catch { } } public static void CreateModEntriesPrefix(object[] __args) { try { Plugin._currentRenderingConfigFilePath = null; if (__args != null && __args.Length >= 2 && __args[1] is ConfigEntryBase[] array && array.Length != 0) { ConfigEntryBase val = array[0]; if (((val != null) ? val.ConfigFile : null) != null) { Plugin._currentRenderingConfigFilePath = val.ConfigFile.ConfigFilePath; } } } catch { } } public static void CreateModEntriesPostfix() { Plugin._currentRenderingConfigFilePath = null; } } internal static class ItemNameLocalizer { private static readonly Regex WhitespaceRegex = new Regex("\\s+", RegexOptions.Compiled); private static readonly Regex PrefixValueRegex = new Regex("^(Arctic|Manor|Museum|Wizard)\\s+(.+)$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex LeadingTypePrefixRegex = new Regex("^(enemy\\s+valuable|valuable\\s*object|valuable|item)\\s+", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex TrailingTypePrefixRegex = new Regex("\\s+(valuable\\s*object|valuable|item)$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex SeparatorRegex = new Regex("[_\\-]+", RegexOptions.Compiled); private static readonly Regex LeadingValuablePrefixRegex = new Regex("^Valuable(?=[A-Z0-9_\\-\\s])", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex LowerUpperBoundaryRegex = new Regex("([a-z])([A-Z])", RegexOptions.Compiled); private static readonly Regex LetterDigitBoundaryRegex = new Regex("([A-Za-z])(\\d)", RegexOptions.Compiled); private static readonly Regex DigitLetterBoundaryRegex = new Regex("(\\d)([A-Za-z])", RegexOptions.Compiled); private static readonly Dictionary ExactNameMap = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "C.A.R.T. Cannon", "C.A.R.T. 加农炮" }, { "C.A.R.T. Laser", "C.A.R.T. 激光炮" }, { "C.A.R.T.", "C.A.R.T.运输车" }, { "POCKET C.A.R.T.", "C.A.R.T.小车" }, { "Recharge Drone", "充能无人机" }, { "Feather Drone", "羽毛无人机" }, { "Indestructible Drone", "无敌无人机" }, { "Roll Drone", "滚动无人机" }, { "Zero Gravity Drone", "零重力无人机" }, { "Duck Bucket", "鸭子桶" }, { "Extraction Tracker", "提取追踪器" }, { "Duct Taped Grenades", "胶带捆绑手榴弹" }, { "Grenade", "手榴弹" }, { "Human Grenade", "人类手榴弹" }, { "Shockwave Grenade", "冲击波手榴弹" }, { "Stun Grenade", "眩晕手榴弹" }, { "AK-47", "AK-47" }, { "Gun", "枪" }, { "Photon Blaster", "光子冲击炮" }, { "Pulse Pistol", "脉冲手枪" }, { "Shotgun", "霰弹枪" }, { "Boltzap", "电击枪" }, { "Tranq Gun", "麻醉枪" }, { "Large Health Pack (100)", "大医疗包 (100)" }, { "Medium Health Pack (50)", "中医疗包 (50)" }, { "Small Health Pack (25)", "小医疗包 (25)" }, { "Leaf Blower", "吹风机" }, { "Baseball Bat", "棒球棍" }, { "Frying Pan", "铁锅" }, { "Inflatable Hammer", "充气锤" }, { "Sledge Hammer", "大锤" }, { "Prodzap", "电击棒" }, { "Sword", "剑" }, { "Explosive Mine", "爆炸地雷" }, { "Shockwave Mine", "冲击波地雷" }, { "Trapzap", "陷阱" }, { "Zero Gravity Orb", "零重力球" }, { "Phase Bridge", "相位桥" }, { "Energy Crystal", "能量水晶" }, { "Defibro", "除颤仪" }, { "Rubber Duck", "橡胶鸭" }, { "Roll Staff", "滚动法杖" }, { "Void Staff", "虚空法杖" }, { "Zero Gravity Staff", "零重力法杖" }, { "Death Head Battery Upgrade", "死亡头部电池升级" }, { "Map Player Count Upgrade", "地图玩家剩余数量升级" }, { "Crouch Rest Upgrade", "下蹲回体升级" }, { "Stamina Upgrade", "体力升级" }, { "Extra Jump Upgrade", "额外跳跃升级" }, { "Range Upgrade", "抓取范围升级" }, { "Strength Upgrade", "力量升级" }, { "Health Upgrade", "生命升级" }, { "Sprint Speed Upgrade", "冲刺速度升级" }, { "Tumble Climb Upgrade", "翻滚抓墙升级" }, { "Tumble Launch Upgrade", "翻滚速度升级" }, { "Tumble Wings Upgrade", "翻滚滑翔升级" }, { "Valuable Tracker", "贵重物品追踪器" }, { "Hauler", "载货车" }, { "Scout", "斥候" }, { "Semibot Walkies", "半机械对讲机套件" }, { "Cart", "推车" }, { "Small Cart", "小推车" }, { "Decor Box", "装饰箱" }, { "Enemy Valuable Small", "滚动珠(小)" }, { "Enemy Valuable Medium", "滚动珠(中)" }, { "Enemy Valuable Large", "滚动珠(大)" }, { "Medium", "滚动珠(中)" }, { "Small", "滚动珠(小)" }, { "Big", "滚动珠(大)" }, { "Large", "滚动珠(大)" }, { "C.A.R.T. Cargo Vehicle", "C.A.R.T.载货车" }, { "Cargo Vehicle", "载货车" }, { "CargoVehicle", "载货车" }, { "ItemVehicle", "载货车" }, { "Item Vehicle", "载货车" }, { "Vehicle", "载货车" }, { "Racing Vehicle", "赛车" }, { "RacingVehicle", "赛车" }, { "Kart", "赛车" }, { "Large Health Pack", "大医疗包" }, { "Medium Health Pack", "中医疗包" }, { "Small Health Pack", "小医疗包" }, { "Stun Mine", "眩晕地雷" }, { "Map Player Count Upgrades", "地图玩家数量升级" }, { "Grenades", "手雷" }, { "Health Upgrades", "生命值升级" }, { "Extra Jump Upgrades", "额外跳跃升级" }, { "Explosive Mines", "爆炸地雷" }, { "Axe", "斧" }, { "Tumble Launch Upgrades", "翻滚发射升级" }, { "Stun Mines", "眩晕地雷" }, { "Stun Grenades", "眩晕手雷" }, { "Strength Upgrades", "力量升级" }, { "Stamina Upgrades", "耐力升级" }, { "Sprint Speed Upgrades", "冲刺速度升级" }, { "Shockwave Mines", "震荡波地雷" }, { "Shockwave Grenades", "震荡波手雷" }, { "Bomb", "炸弹" }, { "Mode: STRONG", "模式:强" }, { "Mode: WEAK", "模式:弱" }, { "Bread", "面包" }, { "Apple", "苹果" }, { "Golden Apple", "金苹果" }, { "Cooked Beef", "烤牛排" }, { "Iron Sword", "铁剑" }, { "Diamond Sword", "钻石剑" }, { "Iron Pickaxe", "铁镐" }, { "Firework", "烟花" }, { "Golden Deagle", "黄金沙鹰" }, { "Keyblade", "钥匙剑" }, { "Exploding Pumpkin", "爆炸南瓜" }, { "Water Balloon", "水气球" }, { "Roblox Bomb", "Roblox 炸弹" }, { "Roblox Rocket Launcher", "Roblox 火箭发射器" }, { "Subspace Tripmine", "量子诡雷" }, { "Rainbow Pistol", "彩虹手枪" }, { "True Knife", "临界匕首" }, { "Moon Stick", "月亮法杖" }, { "Illumina", "伊露米娜" }, { "Ultraviolet Blaster", "紫外脉冲枪" }, { "Blerdly's Halberd", "布勒德利之斧" }, { "Golden AK47", "黄金 AK47" }, { "Devilsknife", "恶魔之刃" }, { "Roblox Paintball Gun", "Roblox 彩弹枪" }, { "Nuclear Bomb", "裂变炸弹" }, { "Freeze Gun (Stun enemies for 5s)", "冻结枪 (暂停怪物 5 秒)" }, { "Freeze Gun", "冻结枪" }, { "Venomous Sniper (Press Z to scope)", "剧毒狙击枪 (按 Z 开镜)" }, { "Venomous Sniper", "剧毒狙击枪" }, { "Rainbow Lucky Block (I wonder what's inside this...)", "彩虹幸运方块 (我也不知道里面有什么...)" }, { "Rainbow Lucky Block", "彩虹幸运方块" }, { "Monster Energy (15)", "魔爪饮料 (15)" }, { "Monster Energy", "魔爪饮料" }, { "M&M Peanut Chocolate Bag (50)", "M&M 巧克力 (50)" }, { "M&M Peanut Chocolate Bag", "M&M 巧克力" }, { "Fortune Healing Potion (65)", "幸运恢复药水 (65)" }, { "Fortune Healing Potion", "幸运恢复药水" }, { "Health Bloxy Cola (15)", "健康 Bloxy 可乐 (15)" }, { "Health Bloxy Cola", "健康 Bloxy 可乐" }, { "Muffet Cereal Box (20)", "Muffet 麦片盒 (20)" }, { "Muffet Cereal Box", "Muffet 麦片盒" }, { "Healing Gun (Shoot to heal teammates)", "恢复枪 (为队友恢复健康)" }, { "Healing Gun", "恢复枪" }, { "Medkit (150)", "绷带 (150)" }, { "Medkit", "绷带" }, { "Beast Minigun", "加特林机枪" }, { "The Moonlight Greatsword", "月光巨剑" }, { "Crimson Periastron", "绯红近星剑" }, { "Summit Shaper", "斫峰之刃" }, { "Candy Cane Basher", "拐杖糖" }, { "Shedletsky Gubby", "Shedletsky Gubby 人偶" }, { "Meowmere", "喵喵神剑" }, { "Guts shotgun", "勇气霰弹枪" }, { "Healing Staff", "治疗法杖" }, { "Haunted Cheezburger [E] (10 seconds GODMODE)", "闹鬼芝士堡 (10秒上帝模式)" }, { "Haunted Cheezburger", "闹鬼芝士堡" }, { "Candy Bucket (100)", "糖果桶 (100)" }, { "Candy Bucket", "糖果桶" }, { "Comic Large Pencil", "漫画巨笔" }, { "Explosive Snowball", "爆炸雪球" }, { "Stop Sign", "停止标志" }, { "Bloxiade (10 seconds speed boost)", "果立方 (10秒速度提升)" }, { "Bloxiade", "果立方" }, { "Teddy Bloxpin (50/50 chance to full heal or kill)", "泰迪·布洛克钉 (50%概率治愈或死亡)" }, { "Teddy Bloxpin", "泰迪·布洛克钉" }, { "Turkey Leg (40)", "火鸡腿 (40)" }, { "Turkey Leg", "火鸡腿" }, { "Pet Rock (This pet kills monsters easily, but they have short lifetime)", "岩宠 (这个宠物很容易杀死怪物,但生命短暂)" }, { "Pet Rock", "岩宠" }, { "Riff Ripper", "猩红撕裂者" }, { "Spray Can", "喷罐" }, { "Halloween Hammer", "万圣之锤" }, { "Baguette", "法棍" }, { "Pizza (40)", "披萨 (40)" }, { "Pizza", "披萨" }, { "Chips for Noobs (20)", "新手薯片 (20)" }, { "Chips for Noobs", "新手薯片" }, { "Xeno Zapper", "电击棒" }, { "Xeno Basher", "电击剑" }, { "Rebar Gun", "射钉枪" }, { "Nobelisk", "锘石炸弹" }, { "Pulse Nobelisk", "脉冲锘石炸弹" }, { "Nobelisk Detonator", "锘石起爆器" }, { "Rifle", "步枪" }, { "Potion (20)", "伤药 (20)" }, { "Potion", "伤药" }, { "Super Potion (60)", "强效药水 (60)" }, { "Super Potion", "强效药水" }, { "Hyper Potion (120)", "厉害伤药 (120)" }, { "Hyper Potion", "厉害伤药" }, { "Max Potion (250)", "全满药 (250)" }, { "Max Potion", "全满药" }, { "Full Restore (500)", "全复药 (500)" }, { "Full Restore", "全复药" }, { "Moomoo Milk (100)", "哞哞牛奶 (100)" }, { "Moomoo Milk", "哞哞牛奶" }, { "Lemonade (70)", "柠檬汁 (70)" }, { "Lemonade", "柠檬汁" }, { "Soda Pop (50)", "劲爽汽水 (50)" }, { "Soda Pop", "劲爽汽水" }, { "Fresh Water (30)", "美味之水 (30)" }, { "Fresh Water", "美味之水" }, { "Energy Powder (60)", "元气粉 (60)" }, { "Energy Powder", "元气粉" }, { "Scatter Bang", "声弹" }, { "Energy Root (120)", "元气根 (120)" }, { "Energy Root", "元气根" }, { "Remedy (60)", "中药 (60)" }, { "Remedy", "中药" }, { "Fine Remedy (100)", "好中药 (100)" }, { "Fine Remedy", "好中药" }, { "Superb Remedy (150)", "厉害中药 (150)" }, { "Superb Remedy", "厉害中药" }, { "Sweet Heart (20)", "心形甜点 (20)" }, { "Sweet Heart", "心形甜点" }, { "Bunk C.A.R.T", "双层推车" }, { "Big C.A.R.T.", "大型推车" }, { "Big Bunk C.A.R.T", "大型双层推车" }, { "Hidey Box", "隐藏箱" }, { "Walkie Talkie", "对讲机" }, { "Walkie-Talkie", "对讲机" }, { "WalkieTalkie", "对讲机" }, { "Walkies", "对讲机" }, { "Walkie Box", "对讲机礼盒" }, { "WalkieBox", "对讲机礼盒" }, { "WalkieTalkieBox", "对讲机礼盒" }, { "Semibot Walkie", "半机械对讲机" }, { "Walkie", "对讲机" } }; private static readonly Dictionary BodyMap = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "3D Printer", "3D打印机" }, { "3 D Printer", "3D打印机" }, { "Alchemy Station", "炼金台" }, { "Animal Crate", "动物箱" }, { "Baby Head", "婴儿头" }, { "Banana Bow", "香蕉蝴蝶结" }, { "Barrel", "桶" }, { "Big Sample", "大型样本" }, { "Bird Skull", "鸟头骨" }, { "Blender", "搅拌机" }, { "Bonsai", "盆景" }, { "Boombox", "音响" }, { "Bottle", "瓶子" }, { "Broom", "扫帚" }, { "Bug", "虫子" }, { "Calculator", "计算器" }, { "Camera", "相机" }, { "Car", "汽车" }, { "Cauldron Box", "坩埚箱" }, { "Centrifuge", "离心机" }, { "Chomp Book", "咬咬书" }, { "Clown", "小丑" }, { "Cocktail", "鸡尾酒" }, { "Coffee Cup", "咖啡杯" }, { "Coffin", "棺材" }, { "Computer", "电脑" }, { "Cool brain", "酷脑" }, { "Creature Leg", "生物腿" }, { "Crown", "王冠" }, { "Cryo Pod", "冷冻舱" }, { "Crystal", "水晶" }, { "Crystal Ball", "水晶球" }, { "Cube ball", "方块球" }, { "Cube of Knowledge", "知识方块" }, { "Cubic Sculpture", "立方雕塑" }, { "Cubic Tower", "立方塔" }, { "Diamond", "钻石" }, { "Diamond Display", "钻石展示架" }, { "Dinosaur", "恐龙" }, { "Doll", "玩偶" }, { "Dragon Skull", "龙头骨" }, { "duck man", "鸭人" }, { "Dumgolfs Staff", "杜姆高夫法杖" }, { "Egg", "蛋" }, { "Emerald Bracelet", "翡翠手镯" }, { "Eraser", "橡皮" }, { "Eye Ball", "眼球" }, { "Eye of Orpigox", "奥匹戈克斯之眼" }, { "Fan", "风扇" }, { "Fire Extinguisher", "灭火器" }, { "Fish", "鱼" }, { "Flamethrower", "火焰喷射器" }, { "Flashlight", "手电筒" }, { "Flesh Blob", "肉团" }, { "Forever Candle", "永燃蜡烛" }, { "Fortune Card", "命运卡" }, { "Frog", "青蛙" }, { "Gem Box", "宝石箱" }, { "Gem Burger", "宝石汉堡" }, { "Globe", "地球仪" }, { "Glowing Jar", "发光罐" }, { "Goblet", "高脚杯" }, { "Goblin Arm", "哥布林手臂" }, { "Goblin Head", "哥布林头" }, { "Golden Statue", "黄金雕像" }, { "Golden Swirl", "金色旋纹" }, { "GoldFish", "金鱼" }, { "Gold Fish", "金鱼" }, { "GoldTooth", "金牙" }, { "Gold Tooth", "金牙" }, { "Gramophone", "留声机" }, { "Grandfather Clock", "落地钟" }, { "Griffin Statue", "狮鹫雕像" }, { "Guitar", "吉他" }, { "Gumball", "口香糖球" }, { "Handface", "手脸" }, { "Hand Face", "手脸" }, { "Harp", "竖琴" }, { "HDD", "硬盘" }, { "Heavy Water", "重水" }, { "Horse", "马" }, { "Ice Block", "冰块" }, { "Ice Saw", "冰锯" }, { "Icepick", "冰镐" }, { "Instrument", "乐器" }, { "Jackhammer", "风镐" }, { "Kettle", "水壶" }, { "Keycard", "钥匙卡" }, { "ladybug", "瓢虫" }, { "Laptop", "笔记本电脑" }, { "Levitation Potion", "漂浮药水" }, { "Love Potion", "爱情药水" }, { "Magnifying Glass", "放大镜" }, { "Map", "地图" }, { "Master Potion", "大师药水" }, { "Milk", "牛奶" }, { "Money", "钱" }, { "MonkeyBox", "猴子盒" }, { "Monkey Box", "猴子盒" }, { "Music Box", "音乐盒" }, { "Ocarina", "陶笛" }, { "Old Camera", "老式相机" }, { "Pacifier", "奶嘴" }, { "Painting", "画作" }, { "Pendant", "吊坠" }, { "Phone", "电话" }, { "Piano", "钢琴" }, { "Pills", "药丸" }, { "PimpleGuy", "痘痘人" }, { "Pimple Guy", "痘痘人" }, { "Plane", "飞机" }, { "Pocket Watch", "怀表" }, { "Poison Chalice", "毒酒杯" }, { "Power Crystal", "能量水晶" }, { "Propane Tank", "丙烷罐" }, { "Radio", "收音机" }, { "Red Mushroom", "红蘑菇" }, { "RubenDoll", "鲁本玩偶" }, { "Ruben Doll", "鲁本玩偶" }, { "Sample", "样本" }, { "Sample Cooler", "样本冷藏箱" }, { "Sample Cooler Wide", "宽样本冷藏箱" }, { "Sample Six Pack", "六联样本" }, { "Scale", "天平" }, { "Science Station", "科研站" }, { "Scream Doll", "尖叫玩偶" }, { "Server Rack", "服务器机柜" }, { "Ship in a bottle", "瓶中船" }, { "SilverFish", "银鱼" }, { "Silver Fish", "银鱼" }, { "Small Gem", "小宝石" }, { "Small Potion", "小药水" }, { "Smartwatch", "智能手表" }, { "Snow Bike", "雪地摩托" }, { "Spider Potion", "蜘蛛药水" }, { "Stapler", "订书机" }, { "Star Wand", "星星魔杖" }, { "Sword", "剑" }, { "Tall Guy", "高个子" }, { "Teeth Bot", "牙齿机器人" }, { "Telescope", "望远镜" }, { "Television", "电视" }, { "Tentacle", "触手" }, { "Time Glass", "时之沙漏" }, { "Toast", "吐司" }, { "Tooth", "牙齿" }, { "Toy Monkey", "玩具猴" }, { "Traffic Light", "红绿灯" }, { "Tray", "托盘" }, { "Troll Finger", "巨魔手指" }, { "Trophy", "奖杯" }, { "Unicorn Horn", "独角兽角" }, { "Uranium Mug", "铀杯" }, { "Uranium Mug Deluxe", "豪华铀杯" }, { "Uranium Petri Dish", "铀培养皿" }, { "Uranium Plate", "铀盘" }, { "Usb stick", "U盘" }, { "Vase", "花瓶" }, { "Vase Big", "大花瓶" }, { "Vase Chunky", "厚花瓶" }, { "Vase Small", "小花瓶" }, { "VHS", "录像带" }, { "Vinyl", "黑胶唱片" }, { "Wire Figure", "铁丝人偶" }, { "Worm", "蠕虫" } }; public static string Translate(string rawName) { string text = CleanName(rawName); if (string.Equals(text, "CART", StringComparison.Ordinal)) { return "C.A.R.T.运输车"; } if (string.Equals(text, "Pocket CART", StringComparison.OrdinalIgnoreCase)) { return "C.A.R.T.小车"; } if (ExactNameMap.TryGetValue(text, out var value)) { return value; } string key = SplitWords(text); if (ExactNameMap.TryGetValue(key, out value)) { return value; } string text2 = CleanDisplayName(rawName); if (string.IsNullOrWhiteSpace(text2)) { return text; } if (ExactNameMap.TryGetValue(text2, out value)) { return value; } string text3 = SplitWords(text2); if (ExactNameMap.TryGetValue(text3, out value)) { return value; } if (TryTranslatePrefixedValuable(text2, out value) || TryTranslatePrefixedValuable(text3, out value)) { return value; } if (TryGetBodyTranslation(text2, out value) || TryGetBodyTranslation(text3, out value)) { return value; } return text3; } public static string CleanDisplayName(string rawName) { string text = NormalizeLeadingValuablePrefix(CleanName(rawName)); string text2 = StripTypePrefix(text); if (!string.IsNullOrWhiteSpace(text2)) { return text2; } return text; } private static bool TryTranslatePrefixedValuable(string value, out string translated) { translated = null; if (string.IsNullOrWhiteSpace(value)) { return false; } if (!TrySplitPrefixAndBody(value, out var _, out var body)) { return false; } if (TryGetBodyTranslation(body, out var translated2)) { translated = translated2; return true; } string text = SplitWords(body); translated = text; return true; } private static bool TryGetBodyTranslation(string value, out string translated) { translated = null; if (string.IsNullOrWhiteSpace(value)) { return false; } if (BodyMap.TryGetValue(value, out translated)) { return true; } string text = SplitWords(value); if (!string.Equals(text, value, StringComparison.OrdinalIgnoreCase) && BodyMap.TryGetValue(text, out translated)) { return true; } string text2 = WhitespaceRegex.Replace(value, string.Empty); if (!string.Equals(text2, value, StringComparison.OrdinalIgnoreCase) && BodyMap.TryGetValue(text2, out translated)) { return true; } return false; } private static bool TrySplitPrefixAndBody(string value, out string prefix, out string body) { prefix = null; body = null; Match match = PrefixValueRegex.Match(value); if (!match.Success) { return false; } prefix = match.Groups[1].Value.Trim(); body = match.Groups[2].Value.Trim(); return !string.IsNullOrWhiteSpace(body); } private static string StripTypePrefix(string name) { if (string.IsNullOrWhiteSpace(name)) { return string.Empty; } string input = SplitWords(name); input = LeadingTypePrefixRegex.Replace(input, string.Empty); input = TrailingTypePrefixRegex.Replace(input, string.Empty); input = WhitespaceRegex.Replace(input, " "); return input.Trim(); } private static string CleanName(string rawName) { if (string.IsNullOrWhiteSpace(rawName)) { return string.Empty; } string input = rawName.Replace("(Clone)", string.Empty).Trim(); input = SeparatorRegex.Replace(input, " "); input = WhitespaceRegex.Replace(input, " "); return input.Trim(); } private static string NormalizeLeadingValuablePrefix(string value) { if (string.IsNullOrWhiteSpace(value)) { return string.Empty; } return LeadingValuablePrefixRegex.Replace(value, string.Empty).Trim(); } private static string SplitWords(string value) { string input = LowerUpperBoundaryRegex.Replace(value, "$1 $2"); input = LetterDigitBoundaryRegex.Replace(input, "$1 $2"); input = DigitLetterBoundaryRegex.Replace(input, "$1 $2"); input = SeparatorRegex.Replace(input, " "); input = WhitespaceRegex.Replace(input, " "); return input.Trim(); } } internal static class EnemyNameLocalizer { private static readonly Regex GroupCountRegex = new Regex("^(?\\d+)\\s+(?.+)$", RegexOptions.Compiled); private static readonly Regex CamelCaseBoundaryRegex = new Regex("(?<=[a-z])(?=[A-Z])", RegexOptions.Compiled); private static readonly Regex LeadingEnemyRegex = new Regex("^Enemy\\s+", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex WhitespaceRegex = new Regex("\\s+", RegexOptions.Compiled); private static readonly Regex ComponentSuffixRegex = new Regex("\\b(Anim|Animation System|Always Active|Attaching|Bot Tilt|Bomb|Camera Visuals|Catch Cutscene|Chase Offset|Controller|Cute Face|Director|Explosion|Eye|Eye Idle|Eye Target|Eye Tilt|Eye Tremble|Float|Fuse|Gas Checker|Gas Guider|Hair|Hair Lean|Hair Target|Hair Tilt|Heal Aura|Hive Attack|Lean|Local Camera|Loop|Old|Particle|Particle Puke Collision|Player Avatar Attached|Pupil|Screen Vein Effect|Sphere Effect|Stun Fly|Tentacle|Tilt|Up|Visual|Visuals)\\b.*$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Dictionary NameMap = new Dictionary(StringComparer.OrdinalIgnoreCase) { ["Animal"] = "蟑螂", ["Enemy Animal"] = "蟑螂", ["Apex Predator"] = "邪恶鸭子", ["Bang"] = "炸弹骷髅", ["Banger"] = "炸弹骷髅", ["Enemy Bang"] = "炸弹骷髅", ["Baby"] = "扔东西小孩", ["Beamer"] = "激光小丑", ["Enemy Beamer"] = "激光小丑", ["Bella"] = "三轮车", ["Birthday Boy"] = "生日男孩", ["Enemy Birthday Boy"] = "生日男孩", ["Bomb Thrower"] = "疯狂厨师青蛙", ["Enemy Bomb Thrower"] = "疯狂厨师青蛙", ["Bowtie"] = "尖叫大白", ["Enemy Bowtie"] = "尖叫大白", ["Ceiling Eye"] = "邪恶大眼", ["Enemy Ceiling Eye"] = "邪恶大眼", ["Chef"] = "疯狂厨师青蛙", ["Cleanup Crew"] = "清洁工", ["Clown"] = "激光小丑", ["Dog"] = "小狗", ["Elsa"] = "小狗", ["Enemy Elsa"] = "小狗", ["Duck"] = "邪恶鸭子", ["Enemy Duck"] = "邪恶鸭子", ["Floater"] = "外星人", ["Enemy Floater"] = "外星人", ["Frog"] = "疯狂厨师青蛙", ["Gambit"] = "赌盘怪", ["Gnome"] = "红帽子侏儒", ["Gnomes"] = "红帽子侏儒", ["Enemy Gnome"] = "红帽子侏儒", ["Head"] = "咬人骷髅头", ["Enemy Head"] = "咬人骷髅头", ["Head Grabber"] = "抢头怪", ["Enemy Head Grabber"] = "抢头怪", ["Headgrab"] = "抢头怪", ["Headman"] = "咬人骷髅头", ["Heart Hugger"] = "爱心花", ["Enemy Heart Hugger"] = "爱心花", ["Hidden"] = "隐身怪", ["Enemy Hidden"] = "隐身怪", ["Hunter"] = "猎人", ["Huntsman"] = "猎人", ["Enemy Hunter"] = "猎人", ["Loom"] = "拍手女", ["Mentalist"] = "外星人", ["Oogly"] = "绿灯怪", ["Enemy Oogly"] = "绿灯怪", ["Peeper"] = "邪恶大眼", ["Peeper Ceiling Eye"] = "邪恶大眼", ["Reaper"] = "电锯小丑", ["Robe"] = "长袍无脸男", ["Enemy Robe"] = "长袍无脸男", ["Rugrat"] = "熊孩子", ["Runner"] = "电锯小丑", ["Enemy Runner"] = "电锯小丑", ["Shadow"] = "拍手女", ["Enemy Shadow"] = "拍手女", ["Shadow Child"] = "娃娃脸小孩", ["Slow Mouth"] = "呕吐怪", ["Enemy Slow Mouth"] = "呕吐怪", ["Slow Walker"] = "大锤版钟馗", ["Enemy Slow Walker"] = "大锤版钟馗", ["Spewer"] = "呕吐怪", ["Spinny"] = "赌盘怪", ["Enemy Spinny"] = "赌盘怪", ["Thin Man"] = "娃娃脸小孩", ["Enemy Thin Man"] = "娃娃脸小孩", ["Tick"] = "吸血虫", ["Enemy Tick"] = "吸血虫", ["Tricycle"] = "三轮车", ["Enemy Tricycle"] = "三轮车", ["Trudge"] = "大锤版钟馗", ["Tumbler"] = "疯狂厨师青蛙", ["Enemy Tumbler"] = "疯狂厨师青蛙", ["Upscream"] = "尖叫", ["Enemy Upscream"] = "尖叫", ["Valuable Thrower"] = "熊孩子", ["Enemy Valuable Thrower"] = "熊孩子", ["Reaper Runner"] = "追击收割者", ["Soldier"] = "士兵", ["Soldier Ghost"] = "幽灵士兵", ["Gusher"] = "喷酸虫", ["Roaster"] = "喷火虫", ["Voodoo"] = "巫毒娃娃", ["Lost droid"] = "迷失的机器人", ["Droid"] = "机器人", ["Destroyer"] = "毁灭者", ["Rolling Giant"] = "滚动巨人", ["Lost Destroyer"] = "迷失的毁灭者", ["Carnivore"] = "肉食者", ["Rugrats"] = "淘气小兵" }; public static string Translate(string rawName) { if (string.IsNullOrWhiteSpace(rawName)) { return string.Empty; } string text = rawName.Trim(); if (NameMap.TryGetValue(text, out var value)) { return value; } string text2 = NormalizeKey(text); if (NameMap.TryGetValue(text2, out value)) { return value; } string text3 = SimplifyEnemyComponentName(text2); if (!string.Equals(text3, text2, StringComparison.OrdinalIgnoreCase) && NameMap.TryGetValue(text3, out value)) { return value; } Match match = GroupCountRegex.Match(text2); if (match.Success) { string value2 = match.Groups["count"].Value; string text4 = match.Groups["name"].Value.Trim(); string text5 = (text4.EndsWith("s", StringComparison.OrdinalIgnoreCase) ? text4.Substring(0, text4.Length - 1) : text4); if (NameMap.TryGetValue(text4, out value)) { return value + " x" + value2; } if (NameMap.TryGetValue(text5, out value)) { return value + " x" + value2; } string key = SimplifyEnemyComponentName(text4); if (NameMap.TryGetValue(key, out value)) { return value + " x" + value2; } string key2 = SimplifyEnemyComponentName(text5); if (NameMap.TryGetValue(key2, out value)) { return value + " x" + value2; } return text4 + " x" + value2; } return text; } private static string NormalizeKey(string rawName) { string input = rawName.Replace("(Clone)", string.Empty).Replace("Enemy Group - ", string.Empty).Replace("Enemy - ", string.Empty) .Replace("Group - ", string.Empty) .Replace("_", " ") .Replace("-", " ") .Trim(); input = CamelCaseBoundaryRegex.Replace(input, " "); input = LeadingEnemyRegex.Replace(input, string.Empty); return WhitespaceRegex.Replace(input, " ").Trim(); } private static string SimplifyEnemyComponentName(string cleaned) { if (string.IsNullOrWhiteSpace(cleaned)) { return string.Empty; } string text = ComponentSuffixRegex.Replace(cleaned, string.Empty).Trim(); if (!string.IsNullOrWhiteSpace(text)) { return text; } return cleaned; } } public class EnemyScaleSync : MonoBehaviourPun { internal void BroadcastScale(int enemyPhotonViewID, float scale) { if (!((Object)(object)((MonoBehaviourPun)this).photonView == (Object)null)) { ((MonoBehaviourPun)this).photonView.RPC("ReceiveEnemyScaleRPC", (RpcTarget)0, new object[2] { enemyPhotonViewID, scale }); } } [PunRPC] private void ReceiveEnemyScaleRPC(int enemyPhotonViewID, float scale, PhotonMessageInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(info)) { return; } Plugin._enemyScaleDict[enemyPhotonViewID] = scale; PhotonView val = PhotonView.Find(enemyPhotonViewID); if (!((Object)(object)val == (Object)null)) { EnemyParent component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { Plugin.ApplyEnemyScale(component, scale); } } } } }