using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using FishNet.Connection; using FishNet.Object; using FishNet.Object.Synchronizing; using HarmonyLib; using Microsoft.CodeAnalysis; using Steamworks; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AimbotRevised")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c06467c114f136a0d0f9eb456ffd0b7ce2bc3248")] [assembly: AssemblyProduct("AimbotRevised")] [assembly: AssemblyTitle("AimbotRevised")] [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 FishAimbotMod { [HarmonyPatch(typeof(PlayerCamera), "ApplyAimAssist")] internal static class AimAssistPatch { private static readonly FieldRef Rotation = AccessTools.FieldRefAccess("_rot"); private static void Postfix(PlayerCamera __instance) { //IL_0023: 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_005c: 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) //IL_006c: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00ea: Unknown result type (might be due to invalid IL or missing references) if (Settings.IsUsable && Settings.AimEnabled && Input.GetKey((KeyCode)324)) { Transform camTransform = __instance.CamTransform; AimTarget aimTarget = Targeting.FindBest(camTransform.position, camTransform.forward, 180f); if (aimTarget.IsValid) { Settings.CurrentTarget = aimTarget; Settings.TargetId = aimTarget.Id; Vector3 val = (Settings.LastTargetPoint = Targeting.GetAimPoint(aimTarget, camTransform.position, camTransform.forward)) - camTransform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Rotation.Invoke(__instance); val2.x = Mathf.Clamp((0f - Mathf.Asin(normalized.y)) * 57.29578f, -90f, 90f); val2.y = Mathf.Atan2(normalized.x, normalized.z) * 57.29578f; Rotation.Invoke(__instance) = val2; } } } } [HarmonyPatch(typeof(Weapon), "Update")] internal static class WeaponAutoShootPatch { private static readonly FieldRef HasCoolDownRef = AccessTools.FieldRefAccess("_hasCoolDown"); private static readonly FieldRef IsReloadingRef = AccessTools.FieldRefAccess("_isReloading"); private static readonly MethodInfo ShootMethod = AccessTools.Method(typeof(Weapon), "Shoot", (Type[])null, (Type[])null); private static readonly FieldRef HoldingFireInputRef = AccessTools.FieldRefAccess("_holdingFireInput"); private static readonly FieldRef QueuedShootRef = AccessTools.FieldRefAccess("_queuedShoot"); private static void Postfix(Weapon __instance) { //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_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_00b4: 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_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_00e7: 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_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_00cb: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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) if (!Settings.IsUsable || !Settings.AutoShootEnabled || !Object.op_Implicit((Object)(object)__instance) || !Object.op_Implicit((Object)(object)((Item)__instance).Holder) || !((NetworkBehaviour)((Item)__instance).Holder).Owner.IsLocalClient || __instance.Ammo <= 0 || IsReloadingRef.Invoke(__instance) || (!Settings.FastShoot && HasCoolDownRef.Invoke(__instance))) { return; } Player holder = ((Item)__instance).Holder; Transform val = (Object.op_Implicit((Object)(object)holder.Camera) ? holder.Camera.CamTransform : holder.CamObject); if (!Object.op_Implicit((Object)(object)val)) { return; } Vector3 position = val.position; Vector3 forward = val.forward; AimTarget aimTarget = Settings.CurrentTarget; if (!aimTarget.IsValid) { aimTarget = Targeting.FindBest(position, forward, 75f); if (!aimTarget.IsValid) { aimTarget = Targeting.FindBest(position, forward, 180f); } } if (!aimTarget.IsValid) { return; } Vector3 aimPoint = Targeting.GetAimPoint(aimTarget, position, forward); if (aimPoint == Vector3.zero) { return; } Vector3 val2 = aimPoint - position; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.1f) { return; } LayerMask val3 = LayerMask.op_Implicit(LayerMask.op_Implicit(GameInfo.LevelLayer) | LayerMask.op_Implicit(GameInfo.BoatLayer)); if (Physics.Raycast(position, ((Vector3)(ref val2)).normalized, magnitude - 0.15f, LayerMask.op_Implicit(val3))) { return; } try { HoldingFireInputRef.Invoke(__instance) = true; QueuedShootRef.Invoke(__instance) = true; ShootMethod.Invoke(__instance, null); Settings.CurrentTarget = aimTarget; Settings.LastTargetPoint = aimPoint; } catch (Exception ex) { Plugin.WriteLog("[AUTO-SHOOT] 自动开枪异常: " + ex.Message); } } } internal static class Tracking { internal static bool TryRedirect(Vector3 position, Vector3 velocity, out Vector3 redirected) { //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_0072: 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_0034: 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_0083: 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_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_0092: 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_0043: 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_00a0: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //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_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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) redirected = velocity; if (!Settings.IsUsable || !Settings.BulletTrackingEnabled) { return false; } AimTarget aimTarget = Settings.CurrentTarget; if (!aimTarget.IsValid) { Vector3 lookDirection = ((((Vector3)(ref velocity)).sqrMagnitude > 0.001f) ? ((Vector3)(ref velocity)).normalized : Vector3.forward); aimTarget = Targeting.FindBest(position, lookDirection, 180f); if (!aimTarget.IsValid) { aimTarget = Targeting.FindBest(position, lookDirection, 360f); } } if (!aimTarget.IsValid) { return false; } AimTarget target = aimTarget; Vector3 normalized; if (!(((Vector3)(ref velocity)).sqrMagnitude > 0.0001f)) { Vector3 val = aimTarget.RootPosition - position; normalized = ((Vector3)(ref val)).normalized; } else { normalized = ((Vector3)(ref velocity)).normalized; } Vector3 aimPoint = Targeting.GetAimPoint(target, position, normalized); Vector3 val2 = aimPoint - position; if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { return false; } redirected = ((Vector3)(ref val2)).normalized * ((Vector3)(ref velocity)).magnitude; Settings.LastTargetPoint = aimPoint; Settings.CurrentTarget = aimTarget; return true; } } [HarmonyPatch(typeof(ProjectileManager), "AddProjectile")] internal static class AddProjectileTrackingPatch { private static void Prefix(bool isLocal, Vector3 pos, ref Vector3 velocity) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 original = velocity; if (isLocal) { Vector3 end; if (Tracking.TryRedirect(pos, velocity, out var redirected)) { velocity = redirected; end = Settings.LastTargetPoint; Settings.RecordRedirect("单发/即时命中", pos, original, redirected); } else { end = pos + ((Vector3)(ref original)).normalized * 120f; } NeonTracerManager.SpawnTracer(pos, end); } } } [HarmonyPatch(typeof(ProjectileManager), "AddProjectiles")] internal static class AddProjectilesTrackingPatch { private static void Prefix(bool isLocal, Vector3 pos, Vector3[] velocities) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!isLocal || velocities == null) { return; } for (int i = 0; i < velocities.Length; i++) { Vector3 original = velocities[i]; Vector3 end; if (Tracking.TryRedirect(pos, velocities[i], out var redirected)) { velocities[i] = redirected; end = Settings.LastTargetPoint; Settings.RecordRedirect("多发/即时命中", pos, original, redirected); } else { end = pos + ((Vector3)(ref original)).normalized * 120f; } NeonTracerManager.SpawnTracer(pos, end); } } } [HarmonyPatch(typeof(ProjectileManager), "UpdateProjectilePos")] internal static class BulletTrackingPatch { private static void Prefix(Projectile projectile) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (projectile != null && projectile.IsLocal) { Vector3 velocity = projectile.Velocity; if (Tracking.TryRedirect(projectile.Position, projectile.Velocity, out var redirected)) { projectile.Velocity = redirected; Settings.RecordRedirect("飞行中", projectile.Position, velocity, redirected); } } } } [HarmonyPatch(typeof(ProjectileManager), "Hit")] internal static class ExplosiveBulletsHitPatch { private static void Postfix(Projectile projectile, ProjectileType type, RaycastHit hit) { //IL_0052: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_00e7: 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_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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Settings.ExplosiveBullets || projectile == null || !projectile.IsLocal) { return; } Vector3 point = ((RaycastHit)(ref hit)).point; try { BossManager.BossExplosion(point, false); AudioManager.PlayClipAt("Explosion", point, false, (AudioDistance)3, 1.2f, 0.1f); } catch { } try { float num = 8.5f; int num2 = 150; Collider[] array = Physics.OverlapSphere(point, num); if (array == null) { return; } List list = new List(); Collider[] array2 = array; foreach (Collider val in array2) { if (!Object.op_Implicit((Object)(object)val)) { continue; } Item val2 = ItemManager.Get(val); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.Creature) && !val2.Creature.IsDead && !list.Contains(val2.Creature)) { list.Add(val2.Creature); Vector3 val3 = ((Component)val2).transform.position - point; Vector3 normalized = ((Vector3)(ref val3)).normalized; val2.Creature.ServerChangeHp(num2); if (Object.op_Implicit((Object)(object)val2.Rig)) { val2.Rig.AddForce((normalized + Vector3.up * 0.5f) * 30f, (ForceMode)1); } } } } catch { } } } [HarmonyPatch(typeof(Weapon), "HasCooldown")] internal static class FastShootPatch { private static bool Prefix(Weapon __instance, ref bool __result) { if (!Settings.IsUsable || !Settings.FastShoot || !Object.op_Implicit((Object)(object)__instance)) { return true; } if (!Object.op_Implicit((Object)(object)((Item)__instance).Holder) || !((NetworkBehaviour)((Item)__instance).Holder).Owner.IsLocalClient) { return true; } __result = false; return false; } } internal static class InventoryExpander { private static readonly FieldRef> ItemSlotsRef = AccessTools.FieldRefAccess>("_itemSlots"); private static readonly MethodInfo UpdateInventoryCameraMethod = AccessTools.Method(typeof(PlayerInventory), "UpdateInventoryCamera", (Type[])null, (Type[])null); internal static void UnlockMaxSlots() { if (!Object.op_Implicit((Object)(object)Player.LocalPlayer) || !Object.op_Implicit((Object)(object)Player.LocalPlayer.Inventory)) { return; } PlayerInventory inventory = Player.LocalPlayer.Inventory; try { inventory.UnlockExtraPocket((byte)2); inventory._extraSlots.Value = 2; List list = ItemSlotsRef.Invoke(inventory); if (list != null) { int num = Mathf.Clamp(3 + inventory._extraSlots.Value, 0, list.Count); for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i] != (Object)null) { list[i].Initialize(i < num); } } } if (UpdateInventoryCameraMethod != null) { UpdateInventoryCameraMethod.Invoke(inventory, null); } inventory.LocalTrySelectSlot(0); Plugin.WriteLog("[INVENTORY] 已成功激活全部 5 个物品栏 (1~5号槽位全部可用)"); } catch (Exception ex) { Plugin.WriteLog("[INVENTORY] 解锁背包异常: " + ex.Message); } } } internal static class ItemSpawnerUtility { internal class SpawnItemEntry { public string RawKey; public string DisplayName; public Item Prefab; } internal enum SpawnerCategory { Weapons, Bosses, Creatures, Supplies } private static readonly Dictionary ChineseNames = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "assault rifle", "突击步枪 (AR)" }, { "pistol", "手枪 (Pistol)" }, { "shotgun", "霰弹枪 (Shotgun)" }, { "smg", "微型冲锋枪 (SMG)" }, { "sniper rifle", "重型狙击枪" }, { "knife", "军用匕首" }, { "brass knuckles", "近战指虎" }, { "fishing rod", "普通钓鱼竿" }, { "crab fishing rod", "专业捕蟹竿" }, { "dynamite", "烈性炸药 / 雷管" }, { "beer", "冰镇啤酒" }, { "badball", "弹力球" }, { "disc", "复古黑胶唱片" }, { "map", "航海地图" }, { "radio", "无线电收音机" }, { "albatross", "巨型信天翁 (Boss)" }, { "blue shark", "远洋蓝鲨 (Boss)" }, { "bowhead whale", "巨型弓头鲸 (Boss)" }, { "giant piranha", "史前巨型食人鱼 (Boss)" }, { "goblin shark", "深海哥布林鲨 (Boss)" }, { "mutated bowhead whale", "辐射变异弓头鲸 (Boss)" }, { "pufferfish", "狂暴巨型河豚 (Boss)" }, { "spidercrab", "深渊巨型蜘蛛蟹 (Boss)" }, { "sunfish", "巨型翻车鱼 (Boss)" }, { "the old pike", "远古白斑巨狗鱼 (Boss)" }, { "tuna", "巨型蓝鳍金枪鱼 (Boss)" }, { "seagull", "海鸥" }, { "salmon", "大西洋三文鱼" }, { "piranha", "热带食人鱼" }, { "catfish", "淡水鲶鱼" }, { "clownfish", "小丑鱼" }, { "eel", "深海电鳗" }, { "flying fish", "飞鱼" }, { "goldfish", "观赏金鱼" }, { "lobster", "澳洲大龙虾" }, { "rockcrab", "岩石蟹" }, { "browncrab", "棕色面包蟹" }, { "seahorse", "海马" }, { "shrimp", "对虾" }, { "clam", "巨蚌 / 珍珠贝" }, { "anglerfish", "深海鮟鱇鱼" }, { "blobfish", "忧郁水滴鱼" }, { "mackerel", "青花鱼 / 鲭鱼" }, { "halibut", "太平洋大比目鱼" }, { "needlefish", "尖嘴针鱼" }, { "oarfish", "皇带鱼 (地震鱼)" }, { "parrotfish", "彩虹鹦嘴鱼" }, { "perch", "黄金河鲈" }, { "pike", "白斑狗鱼" }, { "red snapper", "真红鲷鱼" }, { "stonefish", "剧毒石头鱼" }, { "tigerfish", "凶猛虎鱼" }, { "triggerfish", "热带鳞鲀" }, { "sea urchin", "黑海胆" }, { "dripper", "潮牌滴水兽" }, { "bingbong", "冰棒企鹅鱼" }, { "voxel fish", "像素体素鱼" }, { "footsnail", "大足海蜗牛" }, { "goby", "花纹虾虎鱼" }, { "gar", "远古雀鳝" }, { "leech", "吸血水蛭" }, { "angelfish", "热带神仙鱼" }, { "bass", "大口黑鲈" }, { "bluegill", "蓝鳃太阳鱼" }, { "bowlfish", "圆碗鱼" }, { "cod", "大西洋真鳕鱼" }, { "superdwarf fish", "超级侏儒鱼" }, { "yellow boxfish", "黄木瓜箱鲀" }, { "albatrossmeat", "烤信天翁肉" }, { "crabmeat", "新鲜蟹肉" }, { "piranhameat", "食人鱼肉" }, { "pufferfishmeat", "河豚肉" }, { "whalemeat", "上等鲸鱼肉" }, { "albatross head", "信天翁头标本" }, { "giantpiranhaskeleton", "巨型食人鱼骨标本" }, { "pufferfish fin", "河豚鱼鳍标本" }, { "spidercrab shell", "蜘蛛蟹外壳标本" }, { "whale fin", "鲸鱼尾鳍标本" } }; internal static SpawnerCategory CurrentCategory = SpawnerCategory.Weapons; internal static readonly List WeaponsList = new List(); internal static readonly List BossesList = new List(); internal static readonly List CreaturesList = new List(); internal static readonly List SuppliesList = new List(); internal static bool CacheBuilt = false; internal static int SelectedWeaponIdx = 0; internal static int SelectedBossIdx = 0; internal static int SelectedCreatureIdx = 0; internal static int SelectedSupplyIdx = 0; internal static int SelectedSightType = 0; internal static int SelectedBarrelType = 0; internal static int SelectedDamageLevel = 0; internal static bool SelectedExtMag = true; internal static bool SelectedLaser = true; internal static bool SpawnDrip = false; internal static bool SpawnDead = false; internal static string GetDisplayName(Item item) { if (!Object.op_Implicit((Object)(object)item)) { return "未知物品"; } try { string name = item.GetName(); if (!string.IsNullOrEmpty(name) && !name.StartsWith("#") && name != ((Object)item).name) { return name; } } catch { } if (ChineseNames.TryGetValue(((Object)item).name.Trim(), out var value)) { return value; } return ((Object)item).name; } internal static void EnsureCache() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (CacheBuilt) { return; } CacheBuilt = true; Item[] array = Resources.LoadAll("Items"); if (array == null || array.Length == 0) { return; } Item[] array2 = array; foreach (Item val in array2) { if (!Object.op_Implicit((Object)(object)val)) { continue; } string text = ((Object)val).name.ToLower(); Weapon obj = ((Component)val).GetComponent() ?? ((Component)val).GetComponentInChildren(); Creature val2 = ((Component)val).GetComponent() ?? ((Component)val).GetComponentInChildren(); SpawnItemEntry item = new SpawnItemEntry { RawKey = ((Object)val).name, DisplayName = GetDisplayName(val), Prefab = val }; if ((Object)(object)obj != (Object)null) { WeaponsList.Add(item); } else if ((Object)(object)val2 != (Object)null && !val2.ExcludeFromJournal && !val2.IsDrip) { if ((int)val2.BossType != 0 || text.Contains("shark") || text.Contains("whale") || text.Contains("boss")) { BossesList.Add(item); } else { CreaturesList.Add(item); } } else { SuppliesList.Add(item); } } WeaponsList.Sort((SpawnItemEntry a, SpawnItemEntry b) => string.CompareOrdinal(a.DisplayName, b.DisplayName)); BossesList.Sort((SpawnItemEntry a, SpawnItemEntry b) => string.CompareOrdinal(a.DisplayName, b.DisplayName)); CreaturesList.Sort((SpawnItemEntry a, SpawnItemEntry b) => string.CompareOrdinal(a.DisplayName, b.DisplayName)); SuppliesList.Sort((SpawnItemEntry a, SpawnItemEntry b) => string.CompareOrdinal(a.DisplayName, b.DisplayName)); } internal static string SpawnItem(SpawnItemEntry entry, bool isWeapon) { //IL_0052: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00fa: 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_0249: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) if (entry == null || !Object.op_Implicit((Object)(object)entry.Prefab)) { return "未选择有效物品"; } Transform val = (Object.op_Implicit((Object)(object)GameInfo.CurCamera) ? ((Component)GameInfo.CurCamera).transform : (Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.CamObject : null)); Vector3 val2; Quaternion val3; if ((Object)(object)val != (Object)null) { val2 = val.position + val.forward * 2.5f; val3 = Quaternion.Euler(0f, val.eulerAngles.y, 0f); } else { if (!((Object)(object)Player.LocalPlayer != (Object)null) || !((Object)(object)Player.LocalPlayer.Transform != (Object)null)) { return "本地玩家未处于有效对局中"; } val2 = Player.LocalPlayer.Transform.position + Player.LocalPlayer.Transform.forward * 2f + Vector3.up * 0.5f; val3 = Player.LocalPlayer.Transform.rotation; } Item val4 = Object.Instantiate(entry.Prefab, val2, val3); if (!Object.op_Implicit((Object)(object)val4)) { return "实例化失败"; } if (isWeapon) { Weapon val5 = ((Component)val4).GetComponent() ?? ((Component)val4).GetComponentInChildren(); if ((Object)(object)val5 != (Object)null) { Attachments val6 = val5.Attachments ?? ((Component)val5).GetComponent() ?? ((Component)val5).GetComponentInChildren(); if ((Object)(object)val6 != (Object)null) { ApplyWeaponAttachments(val6); } } } Creature val7 = ((Component)val4).GetComponent() ?? ((Component)val4).GetComponentInChildren(); if ((Object)(object)val7 != (Object)null) { if (SpawnDrip) { val7.SetDrip(); } if (SpawnDead) { val7.ServerKillOnSpawn(); } else { Bird val8 = (Bird)(((object)((val7 is Bird) ? val7 : null)) ?? ((object)(((Component)val4).GetComponent() ?? ((Component)val4).GetComponentInChildren()))); if ((Object)(object)val8 != (Object)null) { float num = val2.y + Random.Range(8f, 16f); AccessTools.PropertySetter(typeof(Bird), "FlyHeigth")?.Invoke(val8, new object[1] { num }); } } } if ((Object)(object)Server.Instance != (Object)null && ((NetworkBehaviour)Server.Instance).IsServerInitialized) { ((NetworkBehaviour)Server.Instance).Spawn(((Component)val4).gameObject, (NetworkConnection)null, default(Scene)); Plugin.WriteLog("[SPAWNER] 服务器广播生成: " + entry.DisplayName); return "✔ 已成功刷出: " + entry.DisplayName; } Plugin.WriteLog("[SPAWNER] 本地已生成: " + entry.DisplayName); return "✔ 已在准星前生成: " + entry.DisplayName; } private static void ApplyWeaponAttachments(Attachments att) { try { List value = Traverse.Create((object)att).Field>("_sights").Value; List value2 = Traverse.Create((object)att).Field>("_barrelAttachments").Value; BulletUpgrade[] value3 = Traverse.Create((object)att).Field("_bulletUpgrades").Value; if (value != null && value.Count > 1) { int num = Mathf.Clamp(SelectedSightType, 0, value.Count - 1); if (num > 0 && (Object)(object)value[num] != (Object)null && (Object)(object)((Attachment)value[num]).Info != (Object)null) { att.SetAttachment(((Attachment)value[num]).Info); } } if (value2 != null && value2.Count > 1) { int num2 = Mathf.Clamp(SelectedBarrelType, 0, value2.Count - 1); if (num2 > 0 && (Object)(object)value2[num2] != (Object)null && (Object)(object)((Attachment)value2[num2]).Info != (Object)null) { att.SetAttachment(((Attachment)value2[num2]).Info); } } if (SelectedLaser) { LaserSight value4 = Traverse.Create((object)att).Field("_laserSight").Value; if ((Object)(object)value4 != (Object)null && (Object)(object)((Attachment)value4).Info != (Object)null) { att.SetAttachment(((Attachment)value4).Info); } } if (SelectedExtMag) { AttachmentInfo value5 = Traverse.Create((object)att).Field("_extendedMagInfo").Value; if ((Object)(object)value5 != (Object)null) { att.SetAttachment(value5); } } if (value3 != null && value3.Length != 0 && SelectedDamageLevel > 0) { int num3 = Mathf.Clamp(SelectedDamageLevel, 0, value3.Length - 1); att._syncedBulletIndex.Value = (byte)num3; } } catch (Exception ex) { Plugin.WriteLog("[SPAWNER] 配件装配异常: " + ex.Message); } } } internal static class MeleeSweep { private static float _lastSweepTime = -99f; private const float SweepCooldown = 0.05f; internal static void SweepAll(Player attacker, int damage, float force) { //IL_0051: 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_0056: 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_0065: 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_00da: 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_00e2: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0113: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Settings.MeleeLongRange || !Object.op_Implicit((Object)(object)attacker) || Time.time - _lastSweepTime < 0.05f) { return; } _lastSweepTime = Time.time; Transform camObject = attacker.CamObject; Vector3 val = (Object.op_Implicit((Object)(object)camObject) ? camObject.position : ((Component)attacker).transform.position); Vector3 val2 = (Object.op_Implicit((Object)(object)camObject) ? camObject.forward : ((Component)attacker).transform.forward); Creature[] array = Object.FindObjectsByType(); int num = 0; Creature[] array2 = array; foreach (Creature val3 in array2) { if (!Object.op_Implicit((Object)(object)val3) || val3.IsDead) { continue; } Fish val4 = (Fish)(object)((val3 is Fish) ? val3 : null); if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)((Item)val4).AttachedRod)) { continue; } Vector3 aimPoint = Targeting.GetAimPoint(new AimTarget { Creature = val3 }, val, val2); Vector3 val5 = aimPoint - val; Vector3 val6; if (!(((Vector3)(ref val5)).sqrMagnitude > 0.0001f)) { val6 = val2; } else { val5 = aimPoint - val; val6 = ((Vector3)(ref val5)).normalized; } Vector3 val7 = val6; Vector3 val8 = val7 * force; if (val8.y < 0f) { val8.y = 0f; } try { ((Item)val3).LocalHit(((Component)val3).transform, aimPoint, val7, attacker, damage, false, val8, false); num++; } catch (Exception ex) { if (Settings.TelemetryEnabled) { Plugin.WriteLog("[SWEEP] hit failed on " + ((Object)val3).name + ": " + ex.Message); } } } Settings.LastSweepCount = num; if (Settings.TelemetryEnabled) { Plugin.WriteLog("[SWEEP] melee sweep hit=" + num + " damage=" + damage); } } } [HarmonyPatch(typeof(PlayerPunching), "FindPunchTarget")] internal static class PunchSweepPatch { private static readonly FieldRef PlayerRef = AccessTools.FieldRefAccess("_player"); private static readonly FieldRef DamageRef = AccessTools.FieldRefAccess("_damage"); private static readonly FieldRef ForceRef = AccessTools.FieldRefAccess("_force"); private static void Postfix(PlayerPunching __instance, bool extraCheckMidPunch) { if (!(!Settings.IsUsable || !Settings.MeleeLongRange || extraCheckMidPunch)) { int damage = (ServerSettings.OneShotEnabled ? 99999 : DamageRef.Invoke(__instance)); MeleeSweep.SweepAll(PlayerRef.Invoke(__instance), damage, ForceRef.Invoke(__instance)); } } } [HarmonyPatch(typeof(Melee), "FindAttackTarget")] internal static class MeleeSweepPatch { private static readonly FieldRef HolderRef = AccessTools.FieldRefAccess("_holder"); private static readonly FieldRef ForceRef = AccessTools.FieldRefAccess("_force"); private static readonly FieldRef SharpnessRef = AccessTools.FieldRefAccess("_sharpnessUpgrades"); private static void Postfix(Melee __instance, bool extraCheckMidAttack) { if (Settings.IsUsable && Settings.MeleeLongRange && !extraCheckMidAttack) { MeleeSweep.SweepAll(HolderRef.Invoke(__instance), ResolveDamage(__instance), ForceRef.Invoke(__instance)); } } private static int ResolveDamage(Melee melee) { if (ServerSettings.OneShotEnabled) { return 99999; } try { SharpnessUpgrade[] array = SharpnessRef.Invoke(melee); if (array != null && array.Length != 0) { int num = melee._syncedSharpnessIndex.Value; if (num < 0 || num >= array.Length) { num = 0; } return array[num].Damage; } } catch (Exception ex) { if (Settings.TelemetryEnabled) { Plugin.WriteLog("[SWEEP] resolve melee damage failed: " + ex.Message); } } return 0; } } [HarmonyPatch(typeof(Creature), "LocalHit")] internal static class MeleeOneShotPatch { private static void Prefix(Creature __instance, Player player, ref int damage, bool rangedHit) { if (Settings.IsUsable && Settings.MeleeOneShot && Object.op_Implicit((Object)(object)__instance) && !rangedHit && Object.op_Implicit((Object)(object)player) && ((NetworkBehaviour)player).Owner.IsLocalClient) { int hp = __instance.Hp; if (hp > 0) { damage = hp; } } } } internal static class NeonTracerManager { private static Material _cachedNeonMat; private static bool _matResolved; private static readonly int IdBaseColor = Shader.PropertyToID("_BaseColor"); private static readonly int IdColor = Shader.PropertyToID("_Color"); private static readonly int IdEmissionColor = Shader.PropertyToID("_EmissionColor"); private static Material ResolveNeonMaterial() { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown if (_matResolved && Object.op_Implicit((Object)(object)_cachedNeonMat)) { return _cachedNeonMat; } _matResolved = true; try { LaserSight[] array = Resources.FindObjectsOfTypeAll(); foreach (LaserSight val in array) { if (Object.op_Implicit((Object)(object)val)) { LineRenderer componentInChildren = ((Component)val).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)((Renderer)componentInChildren).sharedMaterial) && Object.op_Implicit((Object)(object)((Renderer)componentInChildren).sharedMaterial.shader)) { _cachedNeonMat = new Material(((Renderer)componentInChildren).sharedMaterial); Plugin.WriteLog("[NEON] 已克隆游戏激光瞄准器材质: " + ((Object)((Renderer)componentInChildren).sharedMaterial.shader).name); return _cachedNeonMat; } } } } catch { } string[] array2 = new string[5] { "Universal Render Pipeline/Unlit", "Universal Render Pipeline/Particles/Unlit", "Universal Render Pipeline/Lit", "Sprites/Default", "Legacy Shaders/Particles/Additive" }; for (int i = 0; i < array2.Length; i++) { Shader val2 = Shader.Find(array2[i]); if ((Object)(object)val2 != (Object)null) { _cachedNeonMat = new Material(val2); return _cachedNeonMat; } } return null; } internal static void SpawnTracer(Vector3 start, Vector3 end) { //IL_000f: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (Settings.IsUsable && Settings.NeonTracersEnabled && !(Vector3.Distance(start, end) < 0.15f)) { new GameObject("NeonBulletTracer").AddComponent().Initialize(start, end, ResolveNeonMaterial()); } } internal static void ApplyHdrColor(Material mat, Color hdrColor) { //IL_001c: 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_0035: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)mat)) { if (mat.HasProperty(IdBaseColor)) { mat.SetColor(IdBaseColor, hdrColor); } if (mat.HasProperty(IdColor)) { mat.SetColor(IdColor, hdrColor); } try { mat.EnableKeyword("_EMISSION"); } catch { } if (mat.HasProperty(IdEmissionColor)) { mat.SetColor(IdEmissionColor, hdrColor); } } } } internal class NeonTracerInstance : MonoBehaviour { private LineRenderer _line; private Material _matInstance; private readonly List _lights = new List(); private readonly List _lightBaseIntensity = new List(); private float _startTime; private const float Lifetime = 5f; private const float StartWidth = 0.055f; private const float EndWidth = 0.04f; private static readonly Color NeonCyan = new Color(0.1f, 0.95f, 1f, 1f); private static readonly Color NeonMagenta = new Color(1f, 0.12f, 0.8f, 1f); internal void Initialize(Vector3 start, Vector3 end, Material sourceMat) { //IL_003b: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00e3: 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) _startTime = Time.time; _line = ((Component)this).gameObject.AddComponent(); _line.useWorldSpace = true; _line.positionCount = 2; _line.SetPosition(0, start); _line.SetPosition(1, end); _line.startWidth = 0.055f; _line.endWidth = 0.04f; _line.numCapVertices = 4; _line.alignment = (LineAlignment)0; ((Renderer)_line).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)_line).receiveShadows = false; ((Renderer)_line).lightProbeUsage = (LightProbeUsage)0; if ((Object)(object)sourceMat != (Object)null) { _matInstance = new Material(sourceMat); ((Renderer)_line).material = _matInstance; } ApplyVisual(1f); if (Settings.NeonTracerLights) { CreateLightsAlong(start, end); } Object.Destroy((Object)(object)((Component)this).gameObject, 5f); } private void CreateLightsAlong(Vector3 start, Vector3 end) { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(Vector3.Distance(start, end) / 3.5f), 1, 6); for (int i = 0; i < num; i++) { float num2 = ((num == 1) ? 0.5f : ((float)i / (float)(num - 1))); Vector3 position = Vector3.Lerp(start, end, num2); GameObject val = new GameObject("NeonTracerLight_" + i); val.transform.SetParent(((Component)this).transform, true); val.transform.position = position; Light val2 = val.AddComponent(); val2.type = (LightType)2; val2.color = Color.Lerp(NeonCyan, NeonMagenta, num2); val2.range = Settings.NeonLightRange; val2.intensity = Settings.NeonLightIntensity; val2.shadows = (LightShadows)0; val2.renderMode = (LightRenderMode)2; _lights.Add(val2); _lightBaseIntensity.Add(val2.intensity); } } private void ApplyVisual(float alpha) { //IL_0059: 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_0064: 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_0044: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) float neonHdrIntensity = Settings.NeonHdrIntensity; Color val; Color val2; if (Settings.NeonRgbRainbow) { float num = Mathf.Repeat(Time.time * 0.8f, 1f); float num2 = Mathf.Repeat(num + 0.35f, 1f); val = Color.HSVToRGB(num, 0.9f, 1f); val2 = Color.HSVToRGB(num2, 0.9f, 1f); } else { val = NeonCyan; val2 = NeonMagenta; } Color val3 = val * neonHdrIntensity * alpha; Color val4 = val2 * neonHdrIntensity * alpha; val3.a = alpha; val4.a = alpha; if (Object.op_Implicit((Object)(object)_line)) { _line.startColor = val3; _line.endColor = val4; float num3 = Mathf.Lerp(0.1f, 1f, alpha); _line.startWidth = 0.055f * num3; _line.endWidth = 0.04f * num3; } if (Object.op_Implicit((Object)(object)_matInstance)) { NeonTracerManager.ApplyHdrColor(_matInstance, Color.Lerp(val3, val4, 0.5f)); } for (int i = 0; i < _lights.Count; i++) { if (Object.op_Implicit((Object)(object)_lights[i])) { _lights[i].intensity = _lightBaseIntensity[i] * alpha; if (Settings.NeonRgbRainbow) { float num4 = Mathf.Repeat(Time.time * 0.8f + (float)i * 0.15f, 1f); _lights[i].color = Color.HSVToRGB(num4, 0.85f, 1f); } } } } private void Update() { float num = Time.time - _startTime; float alpha = Mathf.Clamp01(1f - num / 5f); ApplyVisual(alpha); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_matInstance)) { Object.Destroy((Object)(object)_matInstance); } } } internal static class NeumorphismUI { internal static readonly Color ColorBase = new Color(0.88f, 0.9f, 0.92f, 1f); internal static readonly Color ColorElevated = new Color(0.93f, 0.94f, 0.96f, 1f); internal static readonly Color ColorShadowDark = new Color(0.7f, 0.72f, 0.75f, 1f); internal static readonly Color ColorShadowLight = new Color(1f, 1f, 1f, 0.95f); internal static readonly Color ColorAccent = new Color(0.4f, 0.35f, 0.95f, 1f); internal static readonly Color ColorAccentBg = new Color(0.78f, 0.76f, 0.96f, 1f); internal static readonly Color ColorTextMain = new Color(0.18f, 0.18f, 0.22f, 1f); internal static readonly Color ColorTextSub = new Color(0.45f, 0.48f, 0.54f, 1f); internal static readonly Color ColorTextAccent = new Color(0.35f, 0.3f, 0.88f, 1f); private static Texture2D _whiteTex; private static Font _cjkFont; private static bool _fontResolved; private static GUIStyle _titleStyle; private static GUIStyle _subTitleStyle; private static GUIStyle _itemTitleStyle; private static GUIStyle _itemDescStyle; private static GUIStyle _tabStyle; private static GUIStyle _tabActiveStyle; private static GUIStyle _btnStyle; private static GUIStyle _btnActiveStyle; private static GUIStyle _smallStyle; private static Font SharedFont => ResolveCjkFont() ?? GUI.skin.label.font; internal static GUIStyle TitleStyle { get { InitStyles(); return _titleStyle; } } internal static GUIStyle SubTitleStyle { get { InitStyles(); return _subTitleStyle; } } internal static GUIStyle ItemTitleStyle { get { InitStyles(); return _itemTitleStyle; } } internal static GUIStyle ItemDescStyle { get { InitStyles(); return _itemDescStyle; } } internal static GUIStyle TabStyle { get { InitStyles(); return _tabStyle; } } internal static GUIStyle TabActiveStyle { get { InitStyles(); return _tabActiveStyle; } } internal static GUIStyle BtnStyle { get { InitStyles(); return _btnStyle; } } internal static GUIStyle BtnActiveStyle { get { InitStyles(); return _btnActiveStyle; } } internal static GUIStyle SmallStyle { get { InitStyles(); return _smallStyle; } } private static Texture2D GetWhiteTex() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_whiteTex)) { _whiteTex = new Texture2D(1, 1); _whiteTex.SetPixel(0, 0, Color.white); _whiteTex.Apply(); } return _whiteTex; } private static Font ResolveCjkFont() { if (_fontResolved) { return _cjkFont; } _fontResolved = true; string[] array = new string[5] { "Microsoft YaHei", "微软雅黑", "SimHei", "SimSun", "Arial" }; foreach (string text in array) { try { Font val = Font.CreateDynamicFontFromOSFont(text, 14); if ((Object)(object)val != (Object)null) { _cjkFont = val; Plugin.WriteLog("[UI] 成功加载系统中文字体: " + text); return _cjkFont; } } catch { } } _cjkFont = Resources.GetBuiltinResource("LegacyRuntime.ttf") ?? Resources.GetBuiltinResource("Arial.ttf"); return _cjkFont; } private static void InitStyles() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0078: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (_titleStyle == null || !((Object)(object)_titleStyle.font == (Object)(object)SharedFont)) { Font sharedFont = SharedFont; _titleStyle = MakeStyle(sharedFont, 15, (FontStyle)1, (TextAnchor)3, ColorTextMain); _subTitleStyle = MakeStyle(sharedFont, 10, (FontStyle)0, (TextAnchor)3, ColorTextAccent); _itemTitleStyle = MakeStyle(sharedFont, 12, (FontStyle)1, (TextAnchor)3, ColorTextMain); _itemDescStyle = MakeStyle(sharedFont, 10, (FontStyle)0, (TextAnchor)3, ColorTextSub); _tabStyle = MakeStyle(sharedFont, 12, (FontStyle)1, (TextAnchor)4, ColorTextSub); _tabActiveStyle = MakeStyle(sharedFont, 12, (FontStyle)1, (TextAnchor)4, ColorAccent); _btnStyle = MakeStyle(sharedFont, 11, (FontStyle)0, (TextAnchor)4, ColorTextMain); _btnActiveStyle = MakeStyle(sharedFont, 11, (FontStyle)1, (TextAnchor)4, ColorAccent); _smallStyle = MakeStyle(sharedFont, 10, (FontStyle)0, (TextAnchor)3, ColorTextSub); } } private static GUIStyle MakeStyle(Font font, int size, FontStyle style, TextAnchor anchor, Color color) { //IL_000a: 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_0016: 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_001e: 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_0025: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { font = font, fontSize = size, fontStyle = style, alignment = anchor, clipping = (TextClipping)1, wordWrap = false }; val.normal.textColor = color; return val; } internal static void DrawSolid(Rect rect, Color col) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = col; GUI.DrawTexture(rect, (Texture)(object)GetWhiteTex()); GUI.color = color; } internal static void DrawSoftShadow(Rect rect, bool isInset, int depth = 3) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_004a: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01bc: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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) Color val = (isInset ? ColorShadowDark : ColorShadowLight); Color val2 = (isInset ? ColorShadowLight : ColorShadowDark); Color col = default(Color); Color col2 = default(Color); for (int i = 0; i < depth; i++) { float num = i + 1; float num2 = Mathf.Lerp(0.8f, 0.2f, (float)i / (float)depth); ((Color)(ref col))..ctor(val.r, val.g, val.b, val.a * num2); ((Color)(ref col2))..ctor(val2.r, val2.g, val2.b, val2.a * num2); if (isInset) { DrawSolid(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + (float)i, ((Rect)(ref rect)).width - (float)i, 1f), col); DrawSolid(new Rect(((Rect)(ref rect)).x + (float)i, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height - (float)i), col); DrawSolid(new Rect(((Rect)(ref rect)).x + (float)i, ((Rect)(ref rect)).yMax - num, ((Rect)(ref rect)).width - (float)i, 1f), col2); DrawSolid(new Rect(((Rect)(ref rect)).xMax - num, ((Rect)(ref rect)).y + (float)i, 1f, ((Rect)(ref rect)).height - (float)i), col2); } else { DrawSolid(new Rect(((Rect)(ref rect)).x - num, ((Rect)(ref rect)).y - num, ((Rect)(ref rect)).width + num, 1f), col); DrawSolid(new Rect(((Rect)(ref rect)).x - num, ((Rect)(ref rect)).y - num, 1f, ((Rect)(ref rect)).height + num), col); DrawSolid(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax + (float)i, ((Rect)(ref rect)).width + num, 1f), col2); DrawSolid(new Rect(((Rect)(ref rect)).xMax + (float)i, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height + num), col2); } } } internal static void DrawNeumorphicPlate(Rect rect, bool isInset, bool isHover = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_000e: Unknown result type (might be due to invalid IL or missing references) int depth = (isHover ? 2 : 3); Color col = (isInset ? ColorBase : (isHover ? ColorElevated : ColorBase)); DrawSolid(rect, col); DrawSoftShadow(rect, isInset, depth); } internal static bool DrawTab(Rect rect, string text, bool isSelected) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) InitStyles(); bool isHover = ((Rect)(ref rect)).Contains(Event.current.mousePosition); DrawNeumorphicPlate(rect, isSelected, isHover); if (isSelected) { DrawSolid(new Rect(((Rect)(ref rect)).x + 8f, ((Rect)(ref rect)).yMax - 3f, ((Rect)(ref rect)).width - 16f, 2f), ColorAccent); } GUI.Label(rect, text, isSelected ? _tabActiveStyle : _tabStyle); if ((int)Event.current.type == 0 && ((Rect)(ref rect)).Contains(Event.current.mousePosition)) { Event.current.Use(); return true; } return false; } internal static bool DrawButton(Rect rect, string text, bool isActive = false) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) InitStyles(); bool isHover = ((Rect)(ref rect)).Contains(Event.current.mousePosition); DrawNeumorphicPlate(rect, isActive, isHover); if (isActive) { DrawSolid(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 4f, 3f, ((Rect)(ref rect)).height - 8f), ColorAccent); } GUI.Label(rect, text, isActive ? _btnActiveStyle : _btnStyle); if ((int)Event.current.type == 0 && ((Rect)(ref rect)).Contains(Event.current.mousePosition)) { Event.current.Use(); return true; } return false; } internal static bool DrawToggleCard(Rect rect, string title, string desc, bool state) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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) InitStyles(); bool isHover = ((Rect)(ref rect)).Contains(Event.current.mousePosition); DrawNeumorphicPlate(rect, state, isHover); if (state) { DrawSolid(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 4f, 3f, ((Rect)(ref rect)).height - 8f), ColorAccent); } float num = 42f; float num2 = 20f; Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).xMax - num - 10f, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - num2) * 0.5f, num, num2); float num3 = ((Rect)(ref rect)).x + 10f; float num4 = ((Rect)(ref rect)).width - num - 22f; if (string.IsNullOrEmpty(desc)) { GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - 20f) * 0.5f, num4, 20f), title, _itemTitleStyle); } else { GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + 4f, num4, 18f), title, _itemTitleStyle); GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + 24f, num4, 16f), desc, _itemDescStyle); } DrawSolid(rect2, state ? ColorAccentBg : ColorBase); DrawSoftShadow(rect2, isInset: true, 2); float num5 = 14f; float num6 = (state ? (((Rect)(ref rect2)).xMax - num5 - 3f) : (((Rect)(ref rect2)).x + 3f)); Rect rect3 = new Rect(num6, ((Rect)(ref rect2)).y + (num2 - num5) * 0.5f, num5, num5); DrawSolid(rect3, state ? ColorAccent : ColorElevated); DrawSoftShadow(rect3, isInset: false, 2); if ((int)Event.current.type == 0 && ((Rect)(ref rect)).Contains(Event.current.mousePosition)) { Event.current.Use(); return !state; } return state; } internal static void DrawTrueCrosshair() { //IL_0041: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_011e: Unknown result type (might be due to invalid IL or missing references) if (Settings.IsUsable && Settings.TrueCrosshairEnabled) { float num = (float)Screen.width * 0.5f; float num2 = (float)Screen.height * 0.5f; DrawSolid(new Rect(num - 3f, num2 - 3f, 6f, 6f), new Color(0f, 0f, 0f, 0.7f)); DrawSolid(new Rect(num - 1.5f, num2 - 1.5f, 3f, 3f), ColorAccent); if (Settings.CrosshairShowLines) { float num3 = 8f; float num4 = 5f; float num5 = 1.5f; DrawSolid(new Rect(num - num3 - num4, num2 - num5 * 0.5f, num3, num5), ColorAccent); DrawSolid(new Rect(num + num4, num2 - num5 * 0.5f, num3, num5), ColorAccent); DrawSolid(new Rect(num - num5 * 0.5f, num2 - num3 - num4, num5, num3), ColorAccent); DrawSolid(new Rect(num - num5 * 0.5f, num2 + num4, num5, num3), ColorAccent); } } } } internal static class NightModeManager { private struct LightBackup { public Color Color; public float Intensity; } private static bool _lastNightState = false; private static bool _hasOriginalBackup = false; private static Color _origAmbientLight; private static float _origAmbientIntensity; private static Color _origFogColor; private static readonly Dictionary _origDirLights = new Dictionary(); internal static void Update() { if (Settings.NightMode != _lastNightState) { _lastNightState = Settings.NightMode; if (Settings.NightMode) { ApplyNightMode(); } else { RestoreDayMode(); } } } private static void ApplyNightMode() { //IL_003f: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) try { if (!_hasOriginalBackup) { _origAmbientLight = RenderSettings.ambientLight; _origAmbientIntensity = RenderSettings.ambientIntensity; _origFogColor = RenderSettings.fogColor; _hasOriginalBackup = true; } RenderSettings.ambientLight = new Color(0.015f, 0.025f, 0.06f, 1f); RenderSettings.ambientIntensity = 0.25f; if (RenderSettings.fog) { RenderSettings.fogColor = new Color(0.008f, 0.012f, 0.035f, 1f); } Light[] array = Resources.FindObjectsOfTypeAll(); _origDirLights.Clear(); Light[] array2 = array; foreach (Light val in array2) { if (Object.op_Implicit((Object)(object)val) && (int)val.type == 1) { _origDirLights[val] = new LightBackup { Color = val.color, Intensity = val.intensity }; val.color = new Color(0.15f, 0.22f, 0.45f, 1f); val.intensity = Mathf.Min(val.intensity * 0.22f, 0.28f); } } Plugin.WriteLog("[NIGHT-MODE] \ud83c\udf19 已成功开启赛博黑夜模式!"); } catch (Exception ex) { Plugin.WriteLog("[NIGHT-MODE] 开启黑夜模式异常: " + ex.Message); } } private static void RestoreDayMode() { //IL_0007: 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_0057: Unknown result type (might be due to invalid IL or missing references) try { if (_hasOriginalBackup) { RenderSettings.ambientLight = _origAmbientLight; RenderSettings.ambientIntensity = _origAmbientIntensity; RenderSettings.fogColor = _origFogColor; } foreach (KeyValuePair origDirLight in _origDirLights) { if ((Object)(object)origDirLight.Key != (Object)null) { origDirLight.Key.color = origDirLight.Value.Color; origDirLight.Key.intensity = origDirLight.Value.Intensity; } } _origDirLights.Clear(); Plugin.WriteLog("[NIGHT-MODE] ☀\ufe0f 已恢复原版白昼光照模式!"); } catch (Exception ex) { Plugin.WriteLog("[NIGHT-MODE] 还原白昼模式异常: " + ex.Message); } } } [HarmonyPatch(typeof(Weapon), "Shoot")] internal static class NoReloadPatch { private static readonly FieldRef AttachmentsRef = AccessTools.FieldRefAccess("_attachments"); private static readonly FieldRef AmmoBackingField = AccessTools.FieldRefAccess("k__BackingField"); private static void Prefix(Weapon __instance) { if (!Settings.IsUsable || !Settings.NoReload || !Object.op_Implicit((Object)(object)__instance)) { return; } Attachments val = AttachmentsRef.Invoke(__instance); if (Object.op_Implicit((Object)(object)val)) { int ammoPerMag = val.AmmoPerMag; if (ammoPerMag > 0 && AmmoBackingField.Invoke(__instance) < ammoPerMag) { AmmoBackingField.Invoke(__instance) = ammoPerMag; } } } } [BepInPlugin("com.yourname.fishaimbot", "Fish Aimbot Unified", "5.0.0")] public sealed class Plugin : BaseUnityPlugin { internal static Plugin Instance; internal static Harmony Harmony; private static Rect _windowRect = new Rect(60f, 60f, 720f, 620f); private static bool _isDragging = false; private static Vector2 _dragOffset; private static bool _isResizing = false; private static Vector2 _resizeStartPos; private static Vector2 _resizeStartSize; private static string _lastSpawnMsg = ""; private static float _spawnMsgTime; private static Vector2 _spawnerScrollPos; private void Awake() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown Instance = this; Harmony = new Harmony("com.yourname.fishaimbot"); int num = 0; int num2 = 0; Type[] types = typeof(Plugin).Assembly.GetTypes(); foreach (Type type in types) { if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: true).Length != 0) { try { Harmony.CreateClassProcessor(type).Patch(); num++; } catch (Exception ex) { num2++; ((BaseUnityPlugin)this).Logger.LogError((object)("补丁失败 " + type.Name + ": " + ex.Message)); } } } ((BaseUnityPlugin)this).Logger.LogInfo((object)("Fish Aimbot Unified v5.0.0 (Official Release / Full Features) loaded (" + num + " 补丁成功). Press F3 to open.")); } internal static void WriteLog(string message) { if (Settings.TelemetryEnabled && (Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)message); } } private void Update() { NightModeManager.Update(); WeaponSkinGlowManager.Update(); if (Input.GetKeyDown((KeyCode)284)) { Settings.MenuOpen = !Settings.MenuOpen; ItemSpawnerUtility.EnsureCache(); PlayerCamera.ToggleMouse(Settings.MenuOpen); } if (Settings.MenuOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } if (Input.GetKeyDown((KeyCode)286)) { Settings.AutoShootEnabled = !Settings.AutoShootEnabled; } if (Input.GetKeyDown((KeyCode)290)) { Settings.TelemetryEnabled = !Settings.TelemetryEnabled; } } private static void HandleWindowDragAndResize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_008b: Invalid comparison between Unknown and I4 //IL_0047: 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: Invalid comparison between Unknown and I4 //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Invalid comparison between Unknown and I4 //IL_0162: 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_00f0: 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_01bf: Invalid comparison between Unknown and I4 //IL_0170: 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_018a: 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_01ce: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; Vector2 mousePosition = current.mousePosition; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _windowRect)).x, ((Rect)(ref _windowRect)).y, ((Rect)(ref _windowRect)).width - 130f, 48f); if ((int)current.type == 0 && ((Rect)(ref val)).Contains(mousePosition)) { _isDragging = true; _dragOffset = mousePosition - new Vector2(((Rect)(ref _windowRect)).x, ((Rect)(ref _windowRect)).y); current.Use(); } else if ((int)current.type == 1 && _isDragging) { _isDragging = false; current.Use(); } else if ((int)current.type == 3 && _isDragging) { ((Rect)(ref _windowRect)).x = Mathf.Clamp(mousePosition.x - _dragOffset.x, 0f, (float)Screen.width - ((Rect)(ref _windowRect)).width); ((Rect)(ref _windowRect)).y = Mathf.Clamp(mousePosition.y - _dragOffset.y, 0f, (float)Screen.height - ((Rect)(ref _windowRect)).height); current.Use(); } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _windowRect)).xMax - 24f, ((Rect)(ref _windowRect)).yMax - 24f, 24f, 24f); if ((int)current.type == 0 && ((Rect)(ref val2)).Contains(mousePosition)) { _isResizing = true; _resizeStartPos = mousePosition; _resizeStartSize = new Vector2(((Rect)(ref _windowRect)).width, ((Rect)(ref _windowRect)).height); current.Use(); } else if ((int)current.type == 1 && _isResizing) { _isResizing = false; current.Use(); } else if ((int)current.type == 3 && _isResizing) { Vector2 val3 = mousePosition - _resizeStartPos; ((Rect)(ref _windowRect)).width = Mathf.Clamp(_resizeStartSize.x + val3.x, 580f, (float)Screen.width - ((Rect)(ref _windowRect)).x); ((Rect)(ref _windowRect)).height = Mathf.Clamp(_resizeStartSize.y + val3.y, 480f, (float)Screen.height - ((Rect)(ref _windowRect)).y); current.Use(); } } private void OnGUI() { //IL_001c: 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_00b8: 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_019b: 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_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0340: 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_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_1526: Unknown result type (might be due to invalid IL or missing references) //IL_1564: Unknown result type (might be due to invalid IL or missing references) //IL_1569: Unknown result type (might be due to invalid IL or missing references) //IL_1571: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_081e: 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_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: 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_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_1245: Unknown result type (might be due to invalid IL or missing references) //IL_1288: Unknown result type (might be due to invalid IL or missing references) //IL_12bd: Unknown result type (might be due to invalid IL or missing references) //IL_12fd: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_1340: Unknown result type (might be due to invalid IL or missing references) //IL_1345: Unknown result type (might be due to invalid IL or missing references) //IL_134c: Unknown result type (might be due to invalid IL or missing references) //IL_0b7c: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: 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_0a84: Unknown result type (might be due to invalid IL or missing references) //IL_13ab: 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_13e1: Unknown result type (might be due to invalid IL or missing references) //IL_1410: Unknown result type (might be due to invalid IL or missing references) //IL_0cb7: Unknown result type (might be due to invalid IL or missing references) //IL_0da3: Unknown result type (might be due to invalid IL or missing references) //IL_0da5: Unknown result type (might be due to invalid IL or missing references) //IL_0daa: Unknown result type (might be due to invalid IL or missing references) //IL_0dac: Unknown result type (might be due to invalid IL or missing references) //IL_0db1: Unknown result type (might be due to invalid IL or missing references) //IL_0cf5: Unknown result type (might be due to invalid IL or missing references) //IL_1442: Unknown result type (might be due to invalid IL or missing references) //IL_143b: Unknown result type (might be due to invalid IL or missing references) //IL_0e5f: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Unknown result type (might be due to invalid IL or missing references) //IL_147d: Unknown result type (might be due to invalid IL or missing references) //IL_0de3: Unknown result type (might be due to invalid IL or missing references) //IL_14af: Unknown result type (might be due to invalid IL or missing references) //IL_14a8: Unknown result type (might be due to invalid IL or missing references) //IL_0f1c: Unknown result type (might be due to invalid IL or missing references) //IL_10f7: Unknown result type (might be due to invalid IL or missing references) //IL_112e: Unknown result type (might be due to invalid IL or missing references) //IL_0f94: Unknown result type (might be due to invalid IL or missing references) //IL_1188: Unknown result type (might be due to invalid IL or missing references) //IL_1008: Unknown result type (might be due to invalid IL or missing references) //IL_105d: Unknown result type (might be due to invalid IL or missing references) //IL_1090: Unknown result type (might be due to invalid IL or missing references) //IL_14e1: Unknown result type (might be due to invalid IL or missing references) //IL_14da: Unknown result type (might be due to invalid IL or missing references) //IL_1210: Unknown result type (might be due to invalid IL or missing references) NeumorphismUI.DrawTrueCrosshair(); if (!Settings.MenuOpen) { return; } GUI.depth = -1000; HandleWindowDragAndResize(); NeumorphismUI.DrawNeumorphicPlate(_windowRect, isInset: false); float num = 16f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _windowRect)).x + num, ((Rect)(ref _windowRect)).y + 10f, ((Rect)(ref _windowRect)).width - num * 2f, 42f); GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + 2f, 320f, 20f), "FISH AIMBOT UNIFIED", NeumorphismUI.TitleStyle); GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + 22f, 320f, 16f), "多功能大一统辅助 · 新拟物软UI v3.3", NeumorphismUI.SubTitleStyle); Settings.MasterEnabled = NeumorphismUI.DrawToggleCard(new Rect(((Rect)(ref _windowRect)).xMax - 130f, ((Rect)(ref val)).y + 2f, 114f, 36f), "主控开关", null, Settings.MasterEnabled); float num2 = ((Rect)(ref _windowRect)).y + 56f; float num3 = (((Rect)(ref _windowRect)).width - num * 2f) / 7f; string[] array = new string[7] { "战斗", "生存", "移动", "视觉", "生成", "联机", "状态" }; for (int i = 0; i < array.Length; i++) { if (NeumorphismUI.DrawTab(new Rect(((Rect)(ref _windowRect)).x + num + (float)i * num3, num2, num3 - 4f, 32f), array[i], Settings.CurrentTab == (MenuTab)i)) { Settings.CurrentTab = (MenuTab)i; } } float num4 = ((Rect)(ref _windowRect)).height - 146f; Rect rect = default(Rect); ((Rect)(ref rect))..ctor(((Rect)(ref _windowRect)).x + num, num2 + 38f, ((Rect)(ref _windowRect)).width - num * 2f, num4); NeumorphismUI.DrawNeumorphicPlate(rect, isInset: true); float num5 = ((Rect)(ref rect)).y + 12f; float num6 = 46f; float num7 = 6f; float num8 = 10f; float num9 = (((Rect)(ref rect)).width - 24f - num8) * 0.5f; float num10 = ((Rect)(ref rect)).x + 12f; float num11 = num10 + num9 + num8; Rect statusCard; float sY; float sLineH; float sPadding; if (Settings.CurrentTab == MenuTab.Combat) { Settings.BulletTrackingEnabled = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "智能子弹追踪 (默认开)", "全向折跃追击目标", Settings.BulletTrackingEnabled); Settings.AimEnabled = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "自瞄吸附锁定", "按住右键(M2)吸附", Settings.AimEnabled); num5 += num6 + num7; if (Settings.BulletTrackingEnabled) { float num12 = 38f; Settings.HeadPriority = NeumorphismUI.DrawToggleCard(new Rect(num10 + 16f, num5, num9 - 16f, num12), "└ 智能弱点追踪", "有头打头·掩体打露出部位", Settings.HeadPriority); num5 += num12 + num7; } Settings.AutoShootEnabled = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "⚡ 自动射击 (F5)", "视线无遮挡时自动极速连发", Settings.AutoShootEnabled); Settings.FastShoot = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "极速连射 (狂暴连击)", "解除射击后摇狂暴泼水", Settings.FastShoot); num5 += num6 + num7; Settings.ExplosiveBullets = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "\ud83d\udca5 炸药子弹 (大爆炸)", "受击引爆真实炸药烟雾火光", Settings.ExplosiveBullets); Settings.NoRecoil = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "无后坐力", "武器射击零后坐力击退", Settings.NoRecoil); num5 += num6 + num7; Settings.NoSpread = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "零散布 (绝对精准)", "弹道零散射打在正中心", Settings.NoSpread); Settings.TargetBirds = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "锁定飞鸟目标", "海鸥/信天翁等空中目标", Settings.TargetBirds); num5 += num6 + num7; Settings.TargetTeammates = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "锁定队友 (玩闹模式)", "准星对准联机队友时可锁定", Settings.TargetTeammates); } else if (Settings.CurrentTab == MenuTab.Survival) { Settings.GodMode = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "\ud83d\udee1\ufe0f 无限生命 (锁血无敌)", "免疫一切伤害与攻击", Settings.GodMode); Settings.InfiniteHunger = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "\ud83c\udf57 无限饱食度", "饱食度锁满永远不挨饿", Settings.InfiniteHunger); num5 += num6 + num7; Settings.KeepInventory = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "死亡不掉落 (双端保全)", "复活后手持与背包物品完整保留", Settings.KeepInventory); Settings.NoReload = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "免换弹 (无限弹匣)", "开火前自动填满弹药畅快连发", Settings.NoReload); num5 += num6 + num7; Settings.MeleeLongRange = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "近战全场群伤", "原地出拳挥刀全图生物受创", Settings.MeleeLongRange); Settings.PeacefulSeagulls = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "海鸥和平模式", "海鸥不再偷抢渔获与地面物品", Settings.PeacefulSeagulls); num5 += num6 + num7; if (Settings.MeleeLongRange) { float num13 = 38f; Settings.MeleeOneShot = NeumorphismUI.DrawToggleCard(new Rect(num10 + 16f, num5, num9 - 16f, num13), "└ 近战一击必杀", "伤害按目标当前血量直接秒杀", Settings.MeleeOneShot); num5 += num13 + num7; } } else if (Settings.CurrentTab == MenuTab.Movement) { string text = "\ud83c\udfc3 移动速度: " + Settings.MoveSpeedMultiplier.ToString("F1") + "x"; if (NeumorphismUI.DrawButton(new Rect(num10, num5, num9, num6), text, Settings.MoveSpeedMultiplier > 1f)) { if (Settings.MoveSpeedMultiplier < 1.5f) { Settings.MoveSpeedMultiplier = 2f; } else if (Settings.MoveSpeedMultiplier < 2.5f) { Settings.MoveSpeedMultiplier = 3f; } else if (Settings.MoveSpeedMultiplier < 4f) { Settings.MoveSpeedMultiplier = 5f; } else { Settings.MoveSpeedMultiplier = 1f; } } string text2 = "\ud83e\udd98 跳跃高度: " + Settings.JumpHeightMultiplier.ToString("F1") + "x"; if (NeumorphismUI.DrawButton(new Rect(num11, num5, num9, num6), text2, Settings.JumpHeightMultiplier > 1f)) { if (Settings.JumpHeightMultiplier < 1.5f) { Settings.JumpHeightMultiplier = 2f; } else if (Settings.JumpHeightMultiplier < 2.5f) { Settings.JumpHeightMultiplier = 3f; } else { Settings.JumpHeightMultiplier = 1f; } } num5 += num6 + num7; Settings.FlyMode = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "\ud83d\udd4a\ufe0f 自由飞天", "空格键上升 / Ctrl键下降", Settings.FlyMode); Settings.NoclipMode = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "\ud83d\udc7b 穿墙模式", "消除物理碰撞穿越障碍物", Settings.NoclipMode); num5 += num6 + num7; Settings.FreeShopping = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "\ud83d\uded2 购买无视金钱 (零元购)", "商店物品完全免费购买", Settings.FreeShopping); Settings.CasinoAlwaysWin = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "\ud83c\udfb0 轮盘赌金币必胜", "押注颜色100%获胜翻倍", Settings.CasinoAlwaysWin); num5 += num6 + num7; if (NeumorphismUI.DrawButton(new Rect(num10, num5, num9, 36f), "\ud83d\udcb0 一键修改金钱 +99999", isActive: true) && (Object)(object)MoneyManager.Instance != (Object)null) { SyncVar money = MoneyManager.Instance._money; money.Value += 99999; } if (NeumorphismUI.DrawButton(new Rect(num11, num5, num9, 36f), "\ud83c\udf92 一键解锁全部背包 (1~5格)", isActive: true)) { InventoryExpander.UnlockMaxSlots(); } num5 += 42f; } else if (Settings.CurrentTab == MenuTab.Visuals) { Settings.NeonTracersEnabled = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "5秒发光霓虹激光", "开火生成静止发光高亮激光束渐隐淡出", Settings.NeonTracersEnabled); Settings.TrueCrosshairEnabled = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "真·中心点准星", "屏幕物理正中心高对比度激光瞄准点", Settings.TrueCrosshairEnabled); num5 += num6 + num7; if (Settings.TrueCrosshairEnabled) { float num14 = 38f; Settings.CrosshairShowLines = NeumorphismUI.DrawToggleCard(new Rect(num11 + 16f, num5, num9 - 16f, num14), "└ 准星十字辅助线", "在中心点外侧渲染四向发光指示线", Settings.CrosshairShowLines); num5 += num14 + num7; } Settings.NightMode = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9, num6), "\ud83c\udf19 赛博黑夜模式", "切换为幽冷暗夜环境(配合霓虹大片感)", Settings.NightMode); Settings.WeaponSkinGlow = NeumorphismUI.DrawToggleCard(new Rect(num11, num5, num9, num6), "\ud83d\udca1 武器皮肤自适应发光", "枪械与匕首按皮肤配色自发光", Settings.WeaponSkinGlow); num5 += num6 + num7; if (Settings.WeaponSkinGlow) { float num15 = 38f; Settings.WeaponSkinGlowLight = NeumorphismUI.DrawToggleCard(new Rect(num10 + 16f, num5, num9 - 16f, num15), "└ 武器环境流光灯", "动态照亮手部与周围环境", Settings.WeaponSkinGlowLight); string text3 = "└ 皮肤辉光强度: " + Settings.WeaponSkinGlowIntensity.ToString("F1") + "x"; if (NeumorphismUI.DrawButton(new Rect(num11 + 16f, num5, num9 - 16f, num15), text3, isActive: true)) { if (Settings.WeaponSkinGlowIntensity < 2f) { Settings.WeaponSkinGlowIntensity = 3f; } else if (Settings.WeaponSkinGlowIntensity < 4f) { Settings.WeaponSkinGlowIntensity = 5f; } else if (Settings.WeaponSkinGlowIntensity < 7f) { Settings.WeaponSkinGlowIntensity = 8f; } else { Settings.WeaponSkinGlowIntensity = 1.5f; } } num5 += num15 + num7; } if (Settings.NeonTracersEnabled) { float num16 = 38f; Settings.NeonTracerLights = NeumorphismUI.DrawToggleCard(new Rect(num10 + 16f, num5, num9 - 16f, num16), "└ 弹道实时点光源", "让霓虹弹道真实照亮周围地面环境", Settings.NeonTracerLights); Settings.NeonRgbRainbow = NeumorphismUI.DrawToggleCard(new Rect(num11 + 16f, num5, num9 - 16f, num16), "└ \ud83c\udf08 RGB 幻彩跑马灯", "弹道呈现彩虹流动跑马灯光晕", Settings.NeonRgbRainbow); num5 += num16 + num7; string text4 = "└ 激光发光强度: " + Settings.NeonHdrIntensity.ToString("F0") + "x"; if (NeumorphismUI.DrawButton(new Rect(num10 + 16f, num5, num9 * 2f + num8 - 16f, num16), text4, isActive: true)) { if (Settings.NeonHdrIntensity < 6f) { Settings.NeonHdrIntensity = 8f; } else if (Settings.NeonHdrIntensity < 12f) { Settings.NeonHdrIntensity = 14f; } else if (Settings.NeonHdrIntensity < 20f) { Settings.NeonHdrIntensity = 22f; } else { Settings.NeonHdrIntensity = 4f; } } num5 += num16 + num7; } } else if (Settings.CurrentTab == MenuTab.Spawner) { ItemSpawnerUtility.EnsureCache(); float num17 = ((Rect)(ref rect)).width - 24f; float num18 = ((Rect)(ref rect)).y + 10f; float num19 = num17 / 4f; string[] array2 = new string[4] { "\ud83d\udd2b 枪械武器", "\ud83d\udc51 巨兽 Boss", "\ud83d\udc1f 海洋生物", "\ud83d\udce6 道具补给" }; for (int j = 0; j < 4; j++) { if (NeumorphismUI.DrawButton(new Rect(((Rect)(ref rect)).x + 12f + (float)j * num19, num18, num19 - 4f, 28f), array2[j], ItemSpawnerUtility.CurrentCategory == (ItemSpawnerUtility.SpawnerCategory)j)) { ItemSpawnerUtility.CurrentCategory = (ItemSpawnerUtility.SpawnerCategory)j; } } List list; int num20; Action action; switch (ItemSpawnerUtility.CurrentCategory) { case ItemSpawnerUtility.SpawnerCategory.Weapons: list = ItemSpawnerUtility.WeaponsList; num20 = ItemSpawnerUtility.SelectedWeaponIdx; action = delegate(int selectedWeaponIdx) { ItemSpawnerUtility.SelectedWeaponIdx = selectedWeaponIdx; }; break; case ItemSpawnerUtility.SpawnerCategory.Bosses: list = ItemSpawnerUtility.BossesList; num20 = ItemSpawnerUtility.SelectedBossIdx; action = delegate(int selectedBossIdx) { ItemSpawnerUtility.SelectedBossIdx = selectedBossIdx; }; break; case ItemSpawnerUtility.SpawnerCategory.Creatures: list = ItemSpawnerUtility.CreaturesList; num20 = ItemSpawnerUtility.SelectedCreatureIdx; action = delegate(int selectedCreatureIdx) { ItemSpawnerUtility.SelectedCreatureIdx = selectedCreatureIdx; }; break; default: list = ItemSpawnerUtility.SuppliesList; num20 = ItemSpawnerUtility.SelectedSupplyIdx; action = delegate(int selectedSupplyIdx) { ItemSpawnerUtility.SelectedSupplyIdx = selectedSupplyIdx; }; break; } float num21 = num18 + 34f; float num22 = 175f; Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x + 12f, num21, num17, num22); NeumorphismUI.DrawNeumorphicPlate(rect2, isInset: false); if (list.Count == 0) { GUI.Label(new Rect(((Rect)(ref rect2)).x + 14f, ((Rect)(ref rect2)).y + 20f, ((Rect)(ref rect2)).width - 28f, 30f), "暂未扫描到该分类物品,请进入游戏场景后重试…", NeumorphismUI.ItemDescStyle); } else { float num23 = ((Rect)(ref rect2)).width - 16f; float num24 = (num23 - 18f) / 3f; float num25 = 28f; float num26 = (float)((list.Count + 2) / 3) * (num25 + 6f) + 10f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref rect2)).x + 8f, ((Rect)(ref rect2)).y + 8f, num23, num22 - 16f); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(0f, 0f, num23 - 16f, Mathf.Max(((Rect)(ref val2)).height, num26)); _spawnerScrollPos = GUI.BeginScrollView(val2, _spawnerScrollPos, val3); for (int num27 = 0; num27 < list.Count; num27++) { int num28 = num27 / 3; int num29 = num27 % 3; Rect rect3 = new Rect((float)num29 * (num24 + 6f), (float)num28 * (num25 + 6f), num24, num25); bool isActive = num20 == num27; if (NeumorphismUI.DrawButton(rect3, list[num27].DisplayName, isActive)) { action(num27); } } GUI.EndScrollView(); } float num30 = num21 + num22 + 10f; float num31 = ((Rect)(ref rect)).yMax - num30 - 12f; Rect rect4 = default(Rect); ((Rect)(ref rect4))..ctor(((Rect)(ref rect)).x + 12f, num30, num17, num31); NeumorphismUI.DrawNeumorphicPlate(rect4, isInset: false); ItemSpawnerUtility.SpawnItemEntry spawnItemEntry = ((list.Count > 0 && num20 >= 0 && num20 < list.Count) ? list[num20] : null); if (spawnItemEntry != null) { float num32 = ((Rect)(ref rect4)).y + 10f; if (ItemSpawnerUtility.CurrentCategory == ItemSpawnerUtility.SpawnerCategory.Weapons) { float num33 = (((Rect)(ref rect4)).width - 32f) / 3f; string[] array3 = new string[4] { "默认机瞄", "红点全息", "4X 倍镜", "8X 狙击镜" }; string text5 = "瞄具: " + array3[ItemSpawnerUtility.SelectedSightType % array3.Length]; if (NeumorphismUI.DrawButton(new Rect(((Rect)(ref rect4)).x + 12f, num32, num33, 30f), text5)) { ItemSpawnerUtility.SelectedSightType = (ItemSpawnerUtility.SelectedSightType + 1) % array3.Length; } string[] array4 = new string[3] { "默认枪管", "止退补偿器", "战术消音器" }; string text6 = "枪口: " + array4[ItemSpawnerUtility.SelectedBarrelType % array4.Length]; if (NeumorphismUI.DrawButton(new Rect(((Rect)(ref rect4)).x + 12f + num33 + 4f, num32, num33, 30f), text6)) { ItemSpawnerUtility.SelectedBarrelType = (ItemSpawnerUtility.SelectedBarrelType + 1) % array4.Length; } string[] array5 = new string[3] { "伤害: 默认", "伤害: 强化LV2", "伤害: 终极LV3" }; string text7 = array5[ItemSpawnerUtility.SelectedDamageLevel % array5.Length]; if (NeumorphismUI.DrawButton(new Rect(((Rect)(ref rect4)).x + 12f + (num33 + 4f) * 2f, num32, num33, 30f), text7)) { ItemSpawnerUtility.SelectedDamageLevel = (ItemSpawnerUtility.SelectedDamageLevel + 1) % array5.Length; } num32 += 36f; float num34 = (((Rect)(ref rect4)).width - 28f) * 0.5f; ItemSpawnerUtility.SelectedExtMag = NeumorphismUI.DrawToggleCard(new Rect(((Rect)(ref rect4)).x + 12f, num32, num34, 36f), "扩容弹匣 (仅升一次)", null, ItemSpawnerUtility.SelectedExtMag); ItemSpawnerUtility.SelectedLaser = NeumorphismUI.DrawToggleCard(new Rect(((Rect)(ref rect4)).x + 16f + num34, num32, num34, 36f), "红外战术激光", null, ItemSpawnerUtility.SelectedLaser); num32 += 42f; } else if (ItemSpawnerUtility.CurrentCategory == ItemSpawnerUtility.SpawnerCategory.Bosses || ItemSpawnerUtility.CurrentCategory == ItemSpawnerUtility.SpawnerCategory.Creatures) { float num35 = (((Rect)(ref rect4)).width - 28f) * 0.5f; ItemSpawnerUtility.SpawnDrip = NeumorphismUI.DrawToggleCard(new Rect(((Rect)(ref rect4)).x + 12f, num32, num35, 36f), "\ud83d\udc51 Drip 潮牌变种", "佩戴墨镜/金链稀有外观", ItemSpawnerUtility.SpawnDrip); ItemSpawnerUtility.SpawnDead = NeumorphismUI.DrawToggleCard(new Rect(((Rect)(ref rect4)).x + 16f + num35, num32, num35, 36f), "\ud83d\udc80 刷出即死", "直接作为战利品/肉掉落", ItemSpawnerUtility.SpawnDead); num32 += 46f; } Rect rect5 = default(Rect); ((Rect)(ref rect5))..ctor(((Rect)(ref rect4)).x + 12f, num32, ((Rect)(ref rect4)).width - 24f, 34f); bool isWeapon = ItemSpawnerUtility.CurrentCategory == ItemSpawnerUtility.SpawnerCategory.Weapons; if (NeumorphismUI.DrawButton(rect5, "⚡ 在准星前生成 [ " + spawnItemEntry.DisplayName + " ]", isActive: true)) { _lastSpawnMsg = ItemSpawnerUtility.SpawnItem(spawnItemEntry, isWeapon); _spawnMsgTime = Time.realtimeSinceStartup; } if (!string.IsNullOrEmpty(_lastSpawnMsg) && Time.realtimeSinceStartup - _spawnMsgTime < 4f) { GUI.Label(new Rect(((Rect)(ref rect4)).x + 14f, ((Rect)(ref rect5)).yMax + 4f, ((Rect)(ref rect4)).width - 28f, 18f), _lastSpawnMsg, NeumorphismUI.SubTitleStyle); } } } else if (Settings.CurrentTab == MenuTab.Multiplayer) { Settings.MorePlayersEnabled = NeumorphismUI.DrawToggleCard(new Rect(num10, num5, num9 * 2f + num8, num6), "突破联机人数上限", "破解官方 4/8 人限制,支持 16 人大房间联机", Settings.MorePlayersEnabled); num5 += num6 + num7; Rect rect6 = default(Rect); ((Rect)(ref rect6))..ctor(num10, num5, num9 * 2f + num8, 84f); NeumorphismUI.DrawNeumorphicPlate(rect6, isInset: false); GUI.Label(new Rect(((Rect)(ref rect6)).x + 14f, ((Rect)(ref rect6)).y + 8f, ((Rect)(ref rect6)).width - 28f, 20f), "房间最大容量设置:16 人开黑", NeumorphismUI.ItemTitleStyle); GUI.Label(new Rect(((Rect)(ref rect6)).x + 14f, ((Rect)(ref rect6)).y + 30f, ((Rect)(ref rect6)).width - 28f, 44f), "房主开启本功能后,创建好友房会自动将 Steam Lobby 容量扩展至 16 人,所有好友均可直接进房加入!", NeumorphismUI.ItemDescStyle); } else if (Settings.CurrentTab == MenuTab.Status) { float num36 = ((Rect)(ref rect)).width - 24f; statusCard = new Rect(num10, num5, num36, num4 - 24f); NeumorphismUI.DrawNeumorphicPlate(statusCard, isInset: false); sY = ((Rect)(ref statusCard)).y + 12f; sLineH = 26f; sPadding = 16f; DrawStatusLine("当前锁定目标:", Settings.CurrentTarget.IsValid ? Settings.CurrentTarget.Name : "无目标", NeumorphismUI.ColorAccent); DrawStatusLine("目标弱点部位:", Settings.LastAimPart, NeumorphismUI.ColorTextMain); DrawStatusLine("弱点世界坐标:", ((Vector3)(ref Settings.LastTargetPoint)).ToString("F2"), NeumorphismUI.ColorTextMain); DrawStatusLine("弹道修正总计:", Settings.RedirectCount + " 发 (" + Settings.LastTrackingPath + ")", NeumorphismUI.ColorAccent); DrawStatusLine("自动射击状态:", Settings.AutoShootEnabled ? "开启 (按 F5 切换)" : "关闭 (按 F5 开启)", Settings.AutoShootEnabled ? NeumorphismUI.ColorAccent : NeumorphismUI.ColorTextSub); DrawStatusLine("群伤上次命中:", Settings.LastSweepCount + " 只生物", NeumorphismUI.ColorTextMain); DrawStatusLine("最近命中目标:", Settings.LastHit, NeumorphismUI.ColorTextAccent); DrawStatusLine("死亡不掉落:", Settings.KeepInventory ? "已启用双端保全" : "原版掉落", Settings.KeepInventory ? NeumorphismUI.ColorAccent : NeumorphismUI.ColorTextSub); DrawStatusLine("控制台遥测:", Settings.TelemetryEnabled ? "开启 (按 F9 切换)" : "关闭 (按 F9 开启)", Settings.TelemetryEnabled ? NeumorphismUI.ColorAccent : NeumorphismUI.ColorTextSub); } GUI.Label(new Rect(((Rect)(ref _windowRect)).x + num, ((Rect)(ref _windowRect)).yMax - 30f, ((Rect)(ref _windowRect)).width - num * 2f - 24f, 22f), "F3 菜单 | F5 自动开火 | M2 自瞄 | 拖拽顶部移动/右下角缩放 | 雪不语 & 芸汐", NeumorphismUI.SmallStyle); Rect rect7 = new Rect(((Rect)(ref _windowRect)).xMax - 16f, ((Rect)(ref _windowRect)).yMax - 16f, 10f, 10f); NeumorphismUI.DrawSoftShadow(rect7, isInset: true, 2); NeumorphismUI.DrawSolid(rect7, NeumorphismUI.ColorAccent); void DrawStatusLine(string label, string text8, Color valColor) { //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(((Rect)(ref statusCard)).x + sPadding, sY, 140f, sLineH), label, NeumorphismUI.ItemTitleStyle); GUIStyle val4 = new GUIStyle(NeumorphismUI.ItemTitleStyle); val4.normal.textColor = valColor; GUIStyle val5 = val4; GUI.Label(new Rect(((Rect)(ref statusCard)).x + sPadding + 140f, sY, ((Rect)(ref statusCard)).width - sPadding * 2f - 140f, sLineH), text8, val5); sY += sLineH; } } } internal enum MenuTab { Combat, Survival, Movement, Visuals, Spawner, Multiplayer, Status } internal static class Settings { internal static bool MenuOpen; internal static MenuTab CurrentTab = MenuTab.Combat; internal static bool MasterEnabled = true; internal static bool AimEnabled = false; internal static bool BulletTrackingEnabled = true; internal static bool AutoShootEnabled = false; internal static bool ExplosiveBullets = false; internal static bool NoRecoil = false; internal static bool NoSpread = false; internal static bool HeadPriority = true; internal static bool FastShoot = true; internal static bool TargetBirds = true; internal static bool TargetTeammates; internal const float TeammatePriorityPenalty = 3f; internal static bool GodMode = false; internal static bool InfiniteHunger = false; internal static bool NoReload; internal static bool MeleeOneShot; internal static bool MeleeLongRange; internal static bool KeepInventory = true; internal static bool PeacefulSeagulls; internal static float MoveSpeedMultiplier = 1f; internal static float JumpHeightMultiplier = 1f; internal static bool FlyMode = false; internal static bool NoclipMode = false; internal static bool FreeShopping = false; internal static bool CasinoAlwaysWin = false; internal static bool NeonTracersEnabled = true; internal static bool NeonRgbRainbow = false; internal static bool NightMode = false; internal static bool WeaponSkinGlow = true; internal static float WeaponSkinGlowIntensity = 3f; internal static bool WeaponSkinGlowLight = true; internal static bool TrueCrosshairEnabled = true; internal static bool CrosshairShowLines = true; internal static bool NeonTracerLights = true; internal static float NeonHdrIntensity = 8f; internal static float NeonLightIntensity = 6f; internal static float NeonLightRange = 7f; internal static int SelectedWeaponIndex = 0; internal static byte SelectedSightIndex = 0; internal static byte SelectedBarrelIndex = 0; internal static byte SelectedAmmoIndex = 0; internal static bool SelectedExtendedMag = true; internal static bool SelectedLaserSight = true; internal static int SelectedCreatureIndex = 0; internal static bool SpawnAsDripCreature = false; internal static bool MorePlayersEnabled = true; internal static int MaxLobbyMembers = 16; internal static bool TelemetryEnabled; internal static int RedirectCount; internal static int LastSweepCount; internal static string LastTrackingPath = "尚未触发"; internal static string LastAimPart = "无"; internal static string LastHit = "无"; internal static AimTarget CurrentTarget; internal static int? TargetId; internal static Vector3 LastTargetPoint; internal static Vector3 LastSourcePosition; internal static Vector3 LastOriginalVelocity; internal static Vector3 LastRedirectedVelocity; internal static bool IsUsable => MasterEnabled; internal static void RefreshTarget() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b1: 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) Transform val = null; if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.CamObject)) { val = Player.LocalPlayer.CamObject; } else if (Object.op_Implicit((Object)(object)Camera.main)) { val = ((Component)Camera.main).transform; } if (!Object.op_Implicit((Object)(object)val)) { CurrentTarget = AimTarget.None; TargetId = null; LastTargetPoint = Vector3.zero; LastAimPart = "无相机"; return; } CurrentTarget = Targeting.FindBest(val.position, val.forward, 180f); if (!CurrentTarget.IsValid) { CurrentTarget = AimTarget.None; TargetId = null; LastTargetPoint = Vector3.zero; LastAimPart = "无目标"; } else { TargetId = CurrentTarget.Id; LastTargetPoint = Targeting.GetAimPoint(CurrentTarget, val.position, val.forward); } } internal static void RecordRedirect(string path, Vector3 source, Vector3 original, Vector3 redirected) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_001f: 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) RedirectCount++; LastTrackingPath = path; LastSourcePosition = source; LastOriginalVelocity = original; LastRedirectedVelocity = redirected; if (TelemetryEnabled && Object.op_Implicit((Object)(object)Plugin.Instance)) { string[] obj = new string[20] { "[TRACK-TEST] redirect path=", path, " local=true target=", CurrentTarget.Name, " part=", LastAimPart, " id=", CurrentTarget.Id.ToString(), " teammate=", CurrentTarget.IsTeammate.ToString(), " source=", ((Vector3)(ref source)).ToString("F3"), " targetRoot=", null, null, null, null, null, null, null }; Vector3 rootPosition = CurrentTarget.RootPosition; obj[13] = ((Vector3)(ref rootPosition)).ToString("F3"); obj[14] = " aim="; obj[15] = ((Vector3)(ref LastTargetPoint)).ToString("F3"); obj[16] = " original="; obj[17] = ((Vector3)(ref original)).ToString("F3"); obj[18] = " redirected="; obj[19] = ((Vector3)(ref redirected)).ToString("F3"); Plugin.WriteLog(string.Concat(obj)); } } } internal static class SurvivalAndMovementPatches { [HarmonyPatch(typeof(PlayerCamera), "MouseInput")] internal static class FreezeCameraWhenMenuOpenPatch { private static bool Prefix() { if (Settings.MenuOpen) { return false; } return true; } } [HarmonyPatch(typeof(PlayerCamera), "ToggleMouse")] internal static class SafeToggleMousePatch { private static void Postfix() { if (Settings.MenuOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } } } [HarmonyPatch(typeof(PlayerVitals), "TakeDamage", new Type[] { typeof(int), typeof(Vector3), typeof(Vector3), typeof(bool) })] internal static class GodModeDamagePatch { private static bool Prefix(PlayerVitals __instance) { if (!Settings.IsUsable || !Settings.GodMode) { return true; } Player val = AccessTools.FieldRefAccess("_player").Invoke(__instance); if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).Owner.IsLocalClient) { return false; } return true; } } [HarmonyPatch(typeof(PlayerVitals), "LocalHit")] internal static class GodModeHitPatch { private static bool Prefix(PlayerVitals __instance) { if (!Settings.IsUsable || !Settings.GodMode) { return true; } Player val = AccessTools.FieldRefAccess("_player").Invoke(__instance); if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).Owner.IsLocalClient) { return false; } return true; } } [HarmonyPatch(typeof(PlayerVitals), "Update")] internal static class InfiniteHungerPatch { private static void Postfix(PlayerVitals __instance) { if (!Settings.IsUsable || !Object.op_Implicit((Object)(object)__instance)) { return; } Player val = AccessTools.FieldRefAccess("_player").Invoke(__instance); if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).Owner.IsLocalClient) { if (Settings.InfiniteHunger) { __instance._syncedFullness.Value = 100; } if (Settings.GodMode) { __instance._syncedHealth.Value = 100; __instance._syncedPoison.Value = 0; __instance._syncedFire.Value = 0; } } } } [HarmonyPatch(typeof(PlayerCamera), "Recoil")] internal static class NoCameraRecoilPatch { private static bool Prefix() { if (Settings.IsUsable && Settings.NoRecoil) { return false; } return true; } } [HarmonyPatch(typeof(PlayerToolMovement), "Recoil")] internal static class NoToolRecoilPatch { private static bool Prefix() { if (Settings.IsUsable && Settings.NoRecoil) { return false; } return true; } } [HarmonyPatch(typeof(Weapon), "AddModelRecoil")] internal static class NoModelRecoilPatch { private static bool Prefix() { if (Settings.IsUsable && Settings.NoRecoil) { return false; } return true; } } [HarmonyPatch(typeof(Weapon), "Shoot")] internal static class NoRecoilSpreadPatch { private static readonly FieldRef SpreadRef = AccessTools.FieldRefAccess("_spread"); private static readonly FieldRef RecoilKnockbackRef = AccessTools.FieldRefAccess("_recoilKnockback"); private static void Prefix(Weapon __instance) { if (Settings.IsUsable && Object.op_Implicit((Object)(object)__instance) && Object.op_Implicit((Object)(object)((Item)__instance).Holder) && ((NetworkBehaviour)((Item)__instance).Holder).Owner.IsLocalClient) { if (Settings.NoSpread) { SpreadRef.Invoke(__instance) = 0f; } if (Settings.NoRecoil) { RecoilKnockbackRef.Invoke(__instance) = 0; } } } } [HarmonyPatch(typeof(PlayerInventory), "get__availableSlots")] internal static class SafeAvailableSlotsPatch { private static readonly FieldRef> ItemSlotsRef = AccessTools.FieldRefAccess>("_itemSlots"); private static readonly MethodInfo GetTotalSlotsMethod = AccessTools.Method(typeof(PlayerInventory), "GetTotalSlots", (Type[])null, (Type[])null); private static bool Prefix(PlayerInventory __instance, ref List __result) { try { List list = ItemSlotsRef.Invoke(__instance); if (list != null && list.Count > 0) { int count = Mathf.Clamp((int)GetTotalSlotsMethod.Invoke(__instance, null), 0, list.Count); __result = list.GetRange(0, count); return false; } } catch { } return true; } } [HarmonyPatch(typeof(PlayerMovement), "FixedUpdate")] internal static class MovementHacksPatch { private static readonly FieldRef WalkSpeedRef = AccessTools.FieldRefAccess("_walkSpeed"); private static readonly FieldRef SprintSpeedRef = AccessTools.FieldRefAccess("_sprintSpeed"); private static readonly FieldRef JumpForceRef = AccessTools.FieldRefAccess("_jumpForce"); private static readonly FieldRef RigRef = AccessTools.FieldRefAccess("_rig"); private static readonly FieldRef ColRef = AccessTools.FieldRefAccess("_col"); private static readonly FieldRef FootColRef = AccessTools.FieldRefAccess("_footCol"); private static readonly FieldRef MoveInputRef = AccessTools.FieldRefAccess("_moveInput"); private static float _origWalk = -1f; private static float _origSprint = -1f; private static float _origJump = -1f; private static void Prefix(PlayerMovement __instance) { //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_01af: 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_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Object.op_Implicit((Object)(object)__instance) || !((NetworkBehaviour)__instance).Owner.IsLocalClient) { return; } if (_origWalk < 0f) { _origWalk = WalkSpeedRef.Invoke(__instance); _origSprint = SprintSpeedRef.Invoke(__instance); _origJump = JumpForceRef.Invoke(__instance); } float num = Mathf.Max(1f, Settings.MoveSpeedMultiplier); WalkSpeedRef.Invoke(__instance) = _origWalk * num; SprintSpeedRef.Invoke(__instance) = _origSprint * num; float num2 = Mathf.Max(1f, Settings.JumpHeightMultiplier); JumpForceRef.Invoke(__instance) = _origJump * num2; Rigidbody val = RigRef.Invoke(__instance); CapsuleCollider val2 = ColRef.Invoke(__instance); SphereCollider val3 = FootColRef.Invoke(__instance); if (Settings.NoclipMode) { if (Object.op_Implicit((Object)(object)val2)) { ((Collider)val2).enabled = false; } if (Object.op_Implicit((Object)(object)val3)) { ((Collider)val3).enabled = false; } if (Object.op_Implicit((Object)(object)val)) { val.detectCollisions = false; val.useGravity = false; Vector2 val4 = MoveInputRef.Invoke(__instance); Player val5 = AccessTools.FieldRefAccess("_player").Invoke(__instance); Transform val6 = ((Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.CamObject)) ? val5.CamObject : ((Component)__instance).transform); Vector3 val7 = val6.forward * val4.y + val6.right * val4.x; if (Input.GetKey((KeyCode)32)) { val7 += Vector3.up; } if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)99)) { val7 += Vector3.down; } if (((Vector3)(ref val7)).sqrMagnitude > 0.01f) { float num3 = 12f * num; val.position += ((Vector3)(ref val7)).normalized * (num3 * Time.fixedDeltaTime); val.linearVelocity = Vector3.zero; } } return; } if (Object.op_Implicit((Object)(object)val2)) { ((Collider)val2).enabled = true; } if (Object.op_Implicit((Object)(object)val3)) { ((Collider)val3).enabled = true; } if (!Object.op_Implicit((Object)(object)val)) { return; } val.detectCollisions = true; if (Settings.FlyMode) { val.useGravity = false; Vector3 val8 = Vector3.zero; if (Input.GetKey((KeyCode)32)) { val8 += Vector3.up * (8f * num); } if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)99)) { val8 += Vector3.down * (8f * num); } val.linearVelocity = new Vector3(val.linearVelocity.x, val8.y, val.linearVelocity.z); } else { val.useGravity = true; } } } [HarmonyPatch(typeof(MoneyManager), "CanAfford")] internal static class FreeShoppingPatch { private static bool Prefix(ref bool __result) { if (Settings.IsUsable && Settings.FreeShopping) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(LocalCasino), "GetRouletteColorFromBall")] internal static class LocalCasinoBallColorPatch { private static bool Prefix(ref BetColor __result) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected I4, but got Unknown if (Settings.IsUsable && Settings.CasinoAlwaysWin) { try { FieldInfo field = typeof(CasinoManager).GetField("_curBetColor", BindingFlags.Static | BindingFlags.NonPublic); if (field != null) { __result = (BetColor)(int)(BetColor)field.GetValue(null); return false; } } catch { } } return true; } } [HarmonyPatch(typeof(CasinoManager), "ServerRouletteResult", new Type[] { typeof(BetColor) })] internal static class CasinoRouletteAlwaysWinPatch { private static void Prefix(CasinoManager __instance, ref BetColor winColor) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected I4, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Settings.CasinoAlwaysWin || (Object)(object)__instance == (Object)null) { return; } try { FieldInfo field = typeof(CasinoManager).GetField("_curBetColor", BindingFlags.Static | BindingFlags.NonPublic); if (field != null) { BetColor val = (BetColor)field.GetValue(null); winColor = (BetColor)(int)val; Plugin.WriteLog($"[CASINO] 轮盘100%必胜生效!获胜颜色已锁定为玩家所选: {val}"); } } catch (Exception ex) { Plugin.WriteLog("[CASINO] 轮盘必胜拦截异常: " + ex.Message); } } } [HarmonyPatch(typeof(Bird), "Awake_UserLogic_Bird_Assembly_002DCSharp_002Edll")] internal static class BirdNaturalFlightHeightPatch { private static void Postfix(Bird __instance) { //IL_0010: 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_004f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)__instance)) { return; } try { float y = ((Component)__instance).transform.position.y; if ((Object)(object)Player.LocalPlayer != (Object)null && y < Player.LocalPlayer.Transform.position.y + 6f) { float num = Player.LocalPlayer.Transform.position.y + Random.Range(10f, 18f); AccessTools.PropertySetter(typeof(Bird), "FlyHeigth")?.Invoke(__instance, new object[1] { num }); } } catch { } } } } internal struct AimTarget { internal Creature Creature; internal Player Teammate; internal bool IsValid { get { if (Object.op_Implicit((Object)(object)Creature)) { return !Creature.IsDead; } return Object.op_Implicit((Object)(object)Teammate); } } internal bool IsTeammate { get { if (!Object.op_Implicit((Object)(object)Creature)) { return Object.op_Implicit((Object)(object)Teammate); } return false; } } internal string Name { get { if (Object.op_Implicit((Object)(object)Creature)) { return ((Object)Creature).name; } if (Object.op_Implicit((Object)(object)Teammate)) { return "队友:" + Teammate.SteamName; } return "null"; } } internal int Id { get { if (Object.op_Implicit((Object)(object)Creature)) { return ((NetworkBehaviour)Creature).ObjectId; } if (Object.op_Implicit((Object)(object)Teammate)) { return ((NetworkBehaviour)Teammate).ObjectId; } return 0; } } internal Vector3 RootPosition { get { //IL_0018: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Creature)) { return ((Component)Creature).transform.position; } if (Object.op_Implicit((Object)(object)Teammate) && Object.op_Implicit((Object)(object)Teammate.Transform)) { return Teammate.Transform.position; } return Vector3.zero; } } internal Transform Root { get { if (Object.op_Implicit((Object)(object)Creature)) { return ((Component)Creature).transform; } if (Object.op_Implicit((Object)(object)Teammate)) { return Teammate.Transform; } return null; } } internal static AimTarget None => default(AimTarget); } internal static class Targeting { internal static AimTarget FindBest(Vector3 cameraPosition, Vector3 lookDirection, float fov) { //IL_00a5: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) AimTarget result = AimTarget.None; float num = float.MaxValue; Creature[] array = Object.FindObjectsByType(); foreach (Creature val in array) { if (!Object.op_Implicit((Object)(object)val) || val.IsDead) { continue; } Fish val2 = (Fish)(object)((val is Fish) ? val : null); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Item)val2).AttachedRod)) { continue; } string text = ((Object)val).name.ToLowerInvariant(); bool flag = text.Contains("seagull") || text.Contains("albatross"); if (!flag || Settings.TargetBirds) { AimTarget aimTarget = new AimTarget { Creature = val }; if (TryScore(aimTarget, cameraPosition, lookDirection, fov, flag, out var score) && score < num) { num = score; result = aimTarget; } } } if (Settings.TargetTeammates && PlayerManager.OtherPlayers != null) { Player localPlayer = Player.LocalPlayer; foreach (Player otherPlayer in PlayerManager.OtherPlayers) { if (!Object.op_Implicit((Object)(object)otherPlayer) || (Object)(object)otherPlayer == (Object)(object)localPlayer || !Object.op_Implicit((Object)(object)otherPlayer.Transform)) { continue; } AimTarget aimTarget2 = new AimTarget { Teammate = otherPlayer }; if (TryScore(aimTarget2, cameraPosition, lookDirection, fov, isBird: false, out var score2)) { score2 += 3f; if (score2 < num) { num = score2; result = aimTarget2; } } } } return result; } private static bool TryScore(AimTarget target, Vector3 cameraPosition, Vector3 lookDirection, float fov, bool isBird, out float score) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) score = float.MaxValue; Vector3 val = GetAimPoint(target, cameraPosition, lookDirection) - cameraPosition; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { return false; } float num = Vector3.Angle(lookDirection, ((Vector3)(ref val)).normalized); if (num > fov * 0.5f) { return false; } float magnitude = ((Vector3)(ref val)).magnitude; score = (isBird ? (num * 0.2f) : (magnitude + num * 0.5f)); return true; } internal static Vector3 GetAimPoint(AimTarget target, Vector3 origin, Vector3 lookDirection) { //IL_0010: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_036d: 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_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_0399: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_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_00eb: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0466: 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_0119: 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_0121: 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_0276: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_0235: 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_0207: Unknown result type (might be due to invalid IL or missing references) Transform root = target.Root; if (!Object.op_Implicit((Object)(object)root)) { return Vector3.zero; } Collider[] componentsInChildren = ((Component)root).GetComponentsInChildren(); if (componentsInChildren == null || componentsInChildren.Length == 0) { return root.position; } LayerMask val = LayerMask.op_Implicit(LayerMask.op_Implicit(GameInfo.LevelLayer) | LayerMask.op_Implicit(GameInfo.BoatLayer)); Collider[] array; if (Object.op_Implicit((Object)(object)target.Creature)) { float headPos = target.Creature.HeadPos; List list = new List(); List list2 = new List(); Vector3 val2 = root.TransformPoint(new Vector3(0f, 0f, headPos + 0.35f)); array = componentsInChildren; foreach (Collider val3 in array) { if (!Object.op_Implicit((Object)(object)val3) || !val3.enabled || val3.isTrigger) { continue; } Vector3 val4 = val3.ClosestPoint(val2); Bounds bounds = val3.bounds; Vector3 center = ((Bounds)(ref bounds)).center; Vector3 val5 = val3.ClosestPoint(origin); Vector3[] array2 = (Vector3[])(object)new Vector3[3] { val4, center, val5 }; foreach (Vector3 val6 in array2) { if (root.InverseTransformPoint(val6).z > headPos) { if (!list.Contains(val6)) { list.Add(val6); } } else if (!list2.Contains(val6)) { list2.Add(val6); } } } if (Settings.HeadPriority && list.Count > 0) { Vector3 result = Vector3.zero; float num = float.MaxValue; foreach (Vector3 item in list) { Vector3 val7 = item - origin; float magnitude = ((Vector3)(ref val7)).magnitude; if (!(magnitude < 0.01f) && !Physics.Raycast(origin, ((Vector3)(ref val7)).normalized, magnitude - 0.05f, LayerMask.op_Implicit(val))) { float num2 = Vector3.Angle(lookDirection, ((Vector3)(ref val7)).normalized); if (num2 < num) { num = num2; result = item; } } } if (num < float.MaxValue) { Settings.LastAimPart = "头部弱点(直击)"; return result; } } Vector3 result2 = Vector3.zero; float num3 = float.MaxValue; foreach (Vector3 item2 in list2) { Vector3 val8 = item2 - origin; float magnitude2 = ((Vector3)(ref val8)).magnitude; if (!(magnitude2 < 0.01f) && !Physics.Raycast(origin, ((Vector3)(ref val8)).normalized, magnitude2 - 0.05f, LayerMask.op_Implicit(val))) { float num4 = Vector3.Angle(lookDirection, ((Vector3)(ref val8)).normalized); if (num4 < num3) { num3 = num4; result2 = item2; } } } if (num3 < float.MaxValue) { Settings.LastAimPart = "身体露出部分(穿插)"; return result2; } Settings.LastAimPart = "掩体后(贴体)"; } else if (Object.op_Implicit((Object)(object)target.Teammate)) { Player teammate = target.Teammate; Vector3 val9 = (Object.op_Implicit((Object)(object)teammate.CamObject) ? teammate.CamObject.position : (target.RootPosition + Vector3.up * 1.5f)); Vector3 val10 = target.RootPosition + Vector3.up * 0.8f; if (Settings.HeadPriority) { Vector3 val11 = val9 - origin; if (!Physics.Raycast(origin, ((Vector3)(ref val11)).normalized, ((Vector3)(ref val11)).magnitude - 0.05f, LayerMask.op_Implicit(val))) { Settings.LastAimPart = "队友头部"; return val9; } } Vector3 val12 = val10 - origin; if (!Physics.Raycast(origin, ((Vector3)(ref val12)).normalized, ((Vector3)(ref val12)).magnitude - 0.05f, LayerMask.op_Implicit(val))) { Settings.LastAimPart = "队友身体"; return val10; } Settings.LastAimPart = "队友掩体后"; return val9; } float num5 = Vector3.Distance(origin, root.position); Vector3 val13 = origin + ((Vector3)(ref lookDirection)).normalized * num5; Vector3 result3 = root.position; float num6 = float.MaxValue; array = componentsInChildren; foreach (Collider val14 in array) { if (Object.op_Implicit((Object)(object)val14) && val14.enabled && !val14.isTrigger) { Vector3 val15 = val14.ClosestPoint(val13); Vector3 val16 = val15 - val13; float sqrMagnitude = ((Vector3)(ref val16)).sqrMagnitude; if (sqrMagnitude < num6) { num6 = sqrMagnitude; result3 = val15; } } } return result3; } } [HarmonyPatch(typeof(PlayerDying), "LocalDie")] internal static class KeepInventoryLocalDiePatch { private static bool Prefix(PlayerDying __instance) { if (!Settings.IsUsable || !Settings.KeepInventory) { return true; } Player val = AccessTools.FieldRefAccess("_player").Invoke(__instance); if (Object.op_Implicit((Object)(object)val)) { val.DeathCam.EnableDeathCam(); if (Object.op_Implicit((Object)(object)BoatManager.Boat) && Object.op_Implicit((Object)(object)BoatManager.Boat.Driver) && ((NetworkBehaviour)BoatManager.Boat.Driver).Owner.IsLocalClient) { Server.Instance.SetDriver((Player)null); } __instance.DeathEffects(); Plugin.WriteLog("[KEEP-INV] 本地死亡已拦截物品丢弃,保留手持与背包物品"); return false; } return true; } } [HarmonyPatch(typeof(PlayerDying), "ServerDie")] internal static class KeepInventoryServerDiePatch { private static bool Prefix(PlayerDying __instance, Vector3 force) { //IL_0064: 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_0086: 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_00a0: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Settings.KeepInventory) { return true; } Player val = AccessTools.FieldRefAccess("_player").Invoke(__instance); if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).Owner.IsLocalClient && (Object)(object)Server.Instance != (Object)null && ((NetworkBehaviour)Server.Instance).IsServerInitialized) { DeadPlayer val2 = Object.Instantiate(GameInfo.DeadPlayerPrefab, val.Transform.position, val.CamObject.rotation, Server.Instance.DynamicObjectsHolder); val2.SetPlayer(val, force); ((NetworkBehaviour)Server.Instance).Spawn(((Component)val2).gameObject, (NetworkConnection)null, default(Scene)); FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerDying), "_deadPlayer"); if (fieldInfo != null) { fieldInfo.SetValue(__instance, val2); } Plugin.WriteLog("[KEEP-INV] 服务端死亡已阻止手持物脱离"); return false; } return true; } } [HarmonyPatch(typeof(SteamManager), "CreateLobby")] internal static class MorePlayersLobbyPatch { private static bool Prefix() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!Settings.IsUsable || !Settings.MorePlayersEnabled) { return true; } int num = Mathf.Clamp(Settings.MaxLobbyMembers, 8, 32); SteamMatchmaking.CreateLobby((ELobbyType)1, num); Plugin.WriteLog("[MORE-PLAYERS] Created Steam Lobby with max limit: " + num); return false; } } [HarmonyPatch(typeof(ItemManager), "AvailableItemForBird")] internal static class PeacefulSeagullsPatch { private static bool Prefix(ref Item __result) { if (Settings.IsUsable && Settings.PeacefulSeagulls) { __result = null; return false; } return true; } } internal static class WeaponSkinGlowManager { private static Item _lastHeldItem; private static float _nextRefreshTime; private static GameObject _weaponLightObj; private static Light _weaponLight; private static readonly int IdBaseMap = Shader.PropertyToID("_BaseMap"); private static readonly int IdMainTex = Shader.PropertyToID("_MainTex"); private static readonly int IdEmissionMap = Shader.PropertyToID("_EmissionMap"); private static readonly int IdEmissionColor = Shader.PropertyToID("_EmissionColor"); private static readonly int IdBaseColor = Shader.PropertyToID("_BaseColor"); private static readonly int IdColor = Shader.PropertyToID("_Color"); private static readonly int IdSkinColor = Shader.PropertyToID("_SkinColor"); private static readonly int IdPrimaryColor = Shader.PropertyToID("_PrimaryColor"); private static readonly int IdSecondColor = Shader.PropertyToID("_SecondColor"); private static readonly int IdThirdColor = Shader.PropertyToID("_ThirdColor"); private static readonly int IdColorOffset = Shader.PropertyToID("_Color_Offset"); private static readonly int IdRainbowSkin = Shader.PropertyToID("_Rainbow_Skin"); internal static void Update() { if (!Settings.IsUsable || !Settings.WeaponSkinGlow || !Object.op_Implicit((Object)(object)Player.LocalPlayer) || !Object.op_Implicit((Object)(object)Player.LocalPlayer.Holding)) { Cleanup(); return; } Item heldItem = Player.LocalPlayer.Holding.HeldItem; if (Time.time >= _nextRefreshTime || (Object)(object)heldItem != (Object)(object)_lastHeldItem) { _nextRefreshTime = Time.time + 0.15f; _lastHeldItem = heldItem; if ((Object)(object)heldItem != (Object)null) { ApplyGlowToWeaponAndHands(heldItem); } } if (Settings.WeaponSkinGlowLight && (Object)(object)heldItem != (Object)null) { UpdateWeaponLight(heldItem); } else if ((Object)(object)_weaponLightObj != (Object)null) { Object.Destroy((Object)(object)_weaponLightObj); _weaponLightObj = null; _weaponLight = null; } } private static void ApplyGlowToWeaponAndHands(Item item) { if (!Object.op_Implicit((Object)(object)item)) { return; } float weaponSkinGlowIntensity = Settings.WeaponSkinGlowIntensity; Renderer[] componentsInChildren = ((Component)item).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.material)) { ApplyMaterialGlow(val.material, weaponSkinGlowIntensity, isHand: false); } } if (!Object.op_Implicit((Object)(object)Player.LocalPlayer.Hands)) { return; } componentsInChildren = ((Component)Player.LocalPlayer.Hands).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.material)) { ApplyMaterialGlow(val2.material, Mathf.Min(weaponSkinGlowIntensity, 2.5f), isHand: true); } } } private static void ApplyMaterialGlow(Material mat, float intensity, bool isHand) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: 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_01d0: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_01ea: 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_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) try { mat.EnableKeyword("_EMISSION"); Texture val = null; if (mat.HasProperty(IdBaseMap)) { val = mat.GetTexture(IdBaseMap); } if ((Object)(object)val == (Object)null && mat.HasProperty(IdMainTex)) { val = mat.GetTexture(IdMainTex); } if ((Object)(object)val != (Object)null && mat.HasProperty(IdEmissionMap)) { mat.SetTexture(IdEmissionMap, val); } Color val2 = Color.white; if (mat.HasProperty(IdColorOffset)) { Vector4 vector = mat.GetVector(IdColorOffset); if (((Vector4)(ref vector)).sqrMagnitude > 0.01f) { ((Color)(ref val2))..ctor(Mathf.Clamp01(vector.x), Mathf.Clamp01(vector.y), Mathf.Clamp01(vector.z), 1f); } } else if (mat.HasProperty(IdPrimaryColor)) { Vector4 vector2 = mat.GetVector(IdPrimaryColor); if (((Vector4)(ref vector2)).sqrMagnitude > 0.01f) { ((Color)(ref val2))..ctor(Mathf.Clamp01(vector2.x), Mathf.Clamp01(vector2.y), Mathf.Clamp01(vector2.z), 1f); } } else if (mat.HasProperty(IdSkinColor)) { Vector4 vector3 = mat.GetVector(IdSkinColor); if (((Vector4)(ref vector3)).sqrMagnitude > 0.01f) { ((Color)(ref val2))..ctor(Mathf.Clamp01(vector3.x), Mathf.Clamp01(vector3.y), Mathf.Clamp01(vector3.z), 1f); } } else if (mat.HasProperty(IdBaseColor)) { val2 = mat.GetColor(IdBaseColor); } else if (mat.HasProperty(IdColor)) { val2 = mat.GetColor(IdColor); } if ((Object)(object)val != (Object)null && val2.r < 0.1f && val2.g < 0.1f && val2.b < 0.1f) { val2 = Color.white; } if (mat.HasProperty(IdRainbowSkin) && mat.GetInt(IdRainbowSkin) == 1) { val2 = Color.HSVToRGB(Mathf.Repeat(Time.time * 0.5f, 1f), 0.85f, 1f); } Color val3 = val2 * intensity; val3.a = 1f; if (mat.HasProperty(IdEmissionColor)) { mat.SetColor(IdEmissionColor, val3); } if (mat.HasProperty(IdBaseColor) && !isHand && (Object)(object)val == (Object)null) { mat.SetColor(IdBaseColor, val2 * Mathf.Min(intensity, 1.8f)); } } catch { } } private static void UpdateWeaponLight(Item item) { //IL_0074: 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_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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0025: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)item)) { if ((Object)(object)_weaponLightObj == (Object)null) { _weaponLightObj = new GameObject("WeaponSkinPointLight"); _weaponLight = _weaponLightObj.AddComponent(); _weaponLight.type = (LightType)2; _weaponLight.range = 4.5f; _weaponLight.shadows = (LightShadows)0; _weaponLight.renderMode = (LightRenderMode)2; } _weaponLightObj.transform.position = ((Component)item).transform.position + ((Component)item).transform.forward * 0.25f + Vector3.up * 0.1f; _weaponLight.intensity = Mathf.Clamp(Settings.WeaponSkinGlowIntensity * 0.8f, 1.2f, 4.5f); float num = Mathf.Repeat(Time.time * 0.35f, 1f); _weaponLight.color = Color.HSVToRGB(num, 0.65f, 1f); } } private static void Cleanup() { if ((Object)(object)_weaponLightObj != (Object)null) { Object.Destroy((Object)(object)_weaponLightObj); _weaponLightObj = null; _weaponLight = null; } _lastHeldItem = null; } } }