Decompiled source of StrayMode v3.0.6
Straymode2.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using GameConsole; using HarmonyLib; using Sandbox; using Straymode.IdentifierCode; using Straymode.InGameCode; using Straymode.InGameCode.CustomProjectiles; using Straymode.WeaponCode; using TMPro; using ULTRAKILL.Cheats; using ULTRAKILL.Portal; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Animations.Rigging; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; using plog; using plog.Models; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Straymode")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("plonk")] [assembly: AssemblyProduct("Straymode")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5711e2a0-d5a7-4ddf-b8d4-00f355fe9397")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: NeutralResourcesLanguage("en-FI")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.0.0.0")] [module: UnverifiableCode] namespace UnityEngine.Animations.Rigging { [ExecuteInEditMode] [AddComponentMenu("Animation Rigging/Setup/Bone Renderer")] [HelpURL("https://docs.unity3d.com/Packages/[email protected]/manual/RiggingWorkflow.html#bone-renderer-component")] public class BoneRenderer : MonoBehaviour { public enum BoneShape { Line, Pyramid, Box } public BoneShape boneShape = BoneShape.Pyramid; public bool drawBones = true; public bool drawTripods; [Range(0.01f, 5f)] public float boneSize = 1f; [Range(0.01f, 5f)] public float tripodSize = 1f; public Color boneColor = new Color(0f, 0f, 1f, 0.5f); [SerializeField] private Transform[] m_Transforms; public Transform[] transforms => m_Transforms; } public interface IRigEffectorHolder { } [DisallowMultipleComponent] [AddComponentMenu("Animation Rigging/Setup/Rig")] [HelpURL("https://docs.unity3d.com/Packages/[email protected]/manual/RiggingWorkflow.html#rig-component")] public class Rig : MonoBehaviour, IRigEffectorHolder { } } namespace Straymode { public class DebugLog : ICommand { public string Name => "straymode-devmode"; public string Description => ""; public string Command => "straymode-devmode"; public void Execute(Console con, string[] args) { MainCode.Debugging = !MainCode.Debugging; MainCode.Log("Debugging " + (MainCode.Debugging ? "Enabled" : "Disabled"), 0, plog: true); } } public class RefreshCat : ICommand { public string Name => "straymode-refresh"; public string Description => ""; public string Command => "straymode-refresh"; public void Execute(Console con, string[] args) { MainCode.RefreshCatalogExperimental(); MainCode.Log("Trying to refresh catalogs...", 2, plog: true); } } public class AnchorJiggle : MonoBehaviour { public bool active = true; public bool moveDirector = true; public Transform parent; public Transform director; private Vector3 origRot; private void Start() { //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) origRot = ((Component)this).transform.localEulerAngles; } private void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0027: 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_0048: 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_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (active) { ((Component)this).transform.LookAt(((Component)this).transform.position - director.up, parent.up); ((Component)this).transform.localRotation = Quaternion.Euler(new Vector3(((Component)this).transform.localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, 0f)); if (moveDirector) { director.rotation = Quaternion.Lerp(director.rotation, Quaternion.identity, 0.1f); } } else { ((Component)this).transform.localRotation = Quaternion.Euler(origRot); } } } public class PlySCBeam : MonoBehaviour { private GameObject hitParticle; public bool active = true; public Vector3 hitPosition; public Quaternion hitRotation; private void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown hitParticle = new GameObject(); } private void Update() { //IL_0007: 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_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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_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) hitPosition = ((Component)this).transform.position + ((Component)this).transform.forward * 100f; Vector3 forward = ((Component)this).transform.forward * -1f; LayerMask val = LayerMaskDefaults.Get((LMD)3); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val2, 100f, LayerMask.op_Implicit(val), (QueryTriggerInteraction)1)) { hitPosition = ((RaycastHit)(ref val2)).point; forward = ((RaycastHit)(ref val2)).normal; } hitParticle.transform.position = hitPosition; hitParticle.transform.forward = forward; hitRotation = hitParticle.transform.rotation; } } internal class Portal : MonoBehaviour { public Transform endpoint; private void OnTriggerEnter(Collider other) { //IL_0027: 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_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_0073: 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_00a2: 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) if (((Component)other).gameObject.CompareTag("Player")) { NewMovement instance = MonoSingleton<NewMovement>.Instance; ((Component)instance).transform.position = endpoint.position; Vector3 forward = endpoint.forward; Vector3 velocity = instance.rb.velocity; instance.Launch(forward, ((Vector3)(ref velocity)).magnitude / 1000f * 1.1f, true); ((Component)instance.cc).transform.localRotation = Quaternion.Euler(endpoint.eulerAngles.x, 0f, 0f); ((Component)instance).transform.rotation = Quaternion.Euler(0f, endpoint.eulerAngles.y, 0f); } Portal portal = default(Portal); if (((Component)other).gameObject.TryGetComponent<Portal>(ref portal)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class SMPluginInfo { public const string guid = "plonk.straymode"; public const string modName = "Straymode2"; public const string ver = "3.0.6"; } [BepInPlugin("plonk.straymode", "Straymode2", "3.0.6")] public class MainCode : BaseUnityPlugin { [Serializable] public class Charge { public float amt; public float target; public float speed; public bool autoRegen; public bool resetToZero; public float resetTo; public Charge cannotAutoWithout; public Charge(float amt, float target, float speed, bool autoRegen, bool resetToZero = false, float resetTo = -1f) { this.amt = amt; this.target = target; this.speed = speed; this.autoRegen = autoRegen; this.resetToZero = resetToZero; this.resetTo = resetTo; } public void SetTo(float percentage) { amt = Mathf.Lerp(0f, target, percentage / 100f); } public void SetToValue(float val) { amt = val; } public void Run() { if ((cannotAutoWithout == null || !(cannotAutoWithout.GetPercentage() < 95f)) && autoRegen) { amt = Mathf.MoveTowards(amt, target, Time.deltaTime * speed); } } public float GetPercentage() { return Mathf.Abs(amt / target) * 100f; } public void Reset(bool noCooldown = false) { if (resetTo == -1f) { if (resetToZero && !noCooldown) { SetTo(0f); } else { SetTo(100f); } } else { SetToValue(resetTo); } } } [HarmonyPatch] public class Patches { public class DualWieldNewIcon : MonoBehaviour { } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Update")] public static bool RemoveDashingIfSuperDashing(NewMovement __instance) { if (!tcenabled) { return true; } if (MonoSingleton<InputManager>.Instance.InputSource.Dodge.WasPerformedThisFrame) { SuperDash instance = MonoSingleton<SuperDash>.Instance; if (instance == null || !(instance.charge >= 100f)) { SuperDash instance2 = MonoSingleton<SuperDash>.Instance; if (instance2 == null || !instance2.Dashing) { goto IL_0051; } } return false; } goto IL_0051; IL_0051: return true; } [HarmonyPostfix] [HarmonyPatch(typeof(Cannonball), "Bounce")] public static void BouncePatch(Cannonball __instance) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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 (tcenabled) { Vector3 val = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 normalized = ((Vector3)(ref val)).normalized; __instance.rb.angularVelocity = normalized * 5f; AudioSource component = ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<AudioSource>(); component.pitch += 1f; } } [HarmonyPostfix] [HarmonyPatch(typeof(Cannonball), "Launch")] public static void LaunchPatch(Cannonball __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (tcenabled) { __instance.rb.angularVelocity = Vector3.zero; } } [HarmonyPostfix] [HarmonyPatch(typeof(RoomCubemap), "Awake")] public static void FuckYouFuckYouFuckYou(RoomCubemap __instance) { if (SceneHelper.CurrentScene == "CreditsMuseum2") { __instance.cam.useOcclusionCulling = false; } } [HarmonyPrefix] [HarmonyPatch(typeof(RoomCubemap), "UpdateCubemap")] public static bool FuckYouFuckYouFuckYou2(RoomCubemap __instance) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (SceneHelper.CurrentScene != "CreditsMuseum2" || !tcenabled) { return true; } __instance.cam.RenderToCubemap(__instance.cubemap); if (museumRoomObjects == null || museumRoomObjects.Length == 0) { museumRoomObjects = ((Component)__instance.room).GetComponentsInChildren<MeshRenderer>(true); } if (__instance.roomObjects == null || __instance.roomObjects.Length == 0) { __instance.roomObjects = museumRoomObjects; } for (int i = 0; i < __instance.roomObjects.Length; i++) { MeshRenderer obj = __instance.roomObjects[i]; ((Renderer)obj).GetPropertyBlock(__instance.propertyBlock); __instance.propertyBlock.SetTexture("_CubeTex", (Texture)(object)__instance.cubemap); __instance.propertyBlock.SetFloat("_CubeMode", (float)__instance.cubemapMode); __instance.propertyBlock.SetFloat("_ReflectionStrength", __instance.cubemapStrength); ((Renderer)obj).SetPropertyBlock(__instance.propertyBlock); } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Dodge")] public static bool SuperDashDahPatch(NewMovement __instance) { if (!tcenabled) { return true; } if (!Object.op_Implicit((Object)(object)MonoSingleton<SuperDash>.Instance)) { return true; } if (MonoSingleton<SuperDash>.Instance.Dashing) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(StaminaMeter), "Update")] public static bool SuperDashMeterPatch(StaminaMeter __instance) { //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: 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_0300: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (!((Component)__instance).TryGetComponent<StraymodeWeaponID>(ref straymodeWeaponID)) { return true; } __instance.UpdateColors(); if (__instance.intro) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton<SuperDash>.Instance.charge + 200f, Time.deltaTime * ((MonoSingleton<SuperDash>.Instance.charge + 200f - __instance.stamina) * 5f + 10f)); if (__instance.stamina >= MonoSingleton<SuperDash>.Instance.charge + 200f) { __instance.intro = false; } } else if (__instance.stamina < MonoSingleton<SuperDash>.Instance.charge + 200f) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton<SuperDash>.Instance.charge + 200f, Time.deltaTime * ((MonoSingleton<SuperDash>.Instance.charge + 200f - __instance.stamina) * 25f + 25f)); } else if (__instance.stamina > MonoSingleton<SuperDash>.Instance.charge + 200f) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton<SuperDash>.Instance.charge + 200f, Time.deltaTime * ((__instance.stamina - (MonoSingleton<SuperDash>.Instance.charge + 200f)) * 25f + 25f)); } if (__instance.alwaysUpdate || (Object.op_Implicit((Object)(object)__instance.parentCanvas) && ((Behaviour)__instance.parentCanvas).enabled)) { if ((Object)(object)__instance.stm != (Object)null) { __instance.stm.value = __instance.stamina; if (__instance.stm.value >= __instance.stm.maxValue && !__instance.full) { __instance.full = true; ((Graphic)__instance.staminaBar).color = __instance.origColor; __instance.Flash(false); } if (__instance.flashColor.a > 0f) { if (__instance.flashColor.a - Time.deltaTime > 0f) { __instance.flashColor.a = __instance.flashColor.a - Time.deltaTime; } else { __instance.flashColor.a = 0f; } ((Graphic)__instance.staminaFlash).color = __instance.flashColor; } if (__instance.stm.value < __instance.stm.maxValue) { __instance.full = false; ((Graphic)__instance.staminaBar).color = __instance.emptyColor; } } if ((Object)(object)__instance.stmText != (Object)null) { if (__instance.lastStamina != __instance.stamina) { __instance.stmText.text = (__instance.stamina / 100f).ToString("0.00"); } __instance.lastStamina = __instance.stamina; if (__instance.changeTextColor) { if (__instance.stamina < 100f) { ((Graphic)__instance.stmText).color = Color.red; return false; } ((Graphic)__instance.stmText).color = MonoSingleton<ColorBlindSettings>.Instance.GetHudColor((HudColorType)5); return false; } if (__instance.normalTextColor == Color.white) { if (__instance.stamina < 100f) { ((Graphic)__instance.stmText).color = Color.red; return false; } ((Graphic)__instance.stmText).color = MonoSingleton<ColorBlindSettings>.Instance.GetHudColor((HudColorType)4); } } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(StaminaMeter), "UpdateColors")] public static bool SuperDashMeterColorPatch(StaminaMeter __instance) { //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_002e: 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_005a: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0111: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (!((Component)__instance).TryGetComponent<StraymodeWeaponID>(ref straymodeWeaponID)) { return true; } Color staminaColor = MonoSingleton<ColorBlindSettings>.Instance.staminaColor; ((Color)(ref staminaColor))..ctor(Mathf.Max(0.5f, 1f - staminaColor.r), Mathf.Max(0.5f, 1f - staminaColor.g), Mathf.Max(0.5f, 1f - staminaColor.b), staminaColor.a); Color staminaEmptyColor = MonoSingleton<ColorBlindSettings>.Instance.staminaEmptyColor; ((Color)(ref staminaEmptyColor))..ctor(Mathf.Max(0.1f, 1f - staminaEmptyColor.r), Mathf.Max(0.1f, 1f - staminaEmptyColor.g), Mathf.Max(0.1f, 1f - staminaEmptyColor.b), staminaEmptyColor.a); Color staminaChargingColor = MonoSingleton<ColorBlindSettings>.Instance.staminaChargingColor; ((Color)(ref staminaChargingColor))..ctor(Mathf.Max(0.25f, 1f - staminaChargingColor.r), Mathf.Max(0.25f, 1f - staminaChargingColor.g), Mathf.Max(0.25f, 1f - staminaChargingColor.b), staminaChargingColor.a); __instance.origColor = staminaColor; if (__instance.redEmpty) { __instance.emptyColor = staminaEmptyColor; } else { __instance.emptyColor = staminaChargingColor; } if (Object.op_Implicit((Object)(object)__instance.staminaBar)) { if (__instance.full) { ((Graphic)__instance.staminaBar).color = __instance.origColor; return false; } ((Graphic)__instance.staminaBar).color = __instance.emptyColor; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "GetHurt")] public static bool DashIFrames(NewMovement __instance, bool invincible, float scoreLossMultiplier = 1f, bool explosion = false, bool instablack = false, float hardDamageMultiplier = 0.35f, bool ignoreInvincibility = false) { if (!tcenabled) { return true; } if (ignoreInvincibility) { return true; } if ((Object)(object)MonoSingleton<SuperDash>.instance == (Object)null) { return true; } if ((Object)(object)MonoSingleton<SuperDash>.instance != (Object)null && MonoSingleton<SuperDash>.instance.hasIFrames) { return false; } if (telefragging) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Jump")] public static void CancelDash(NewMovement __instance) { if ((Object)(object)MonoSingleton<SuperDash>.instance != (Object)null) { MonoSingleton<SuperDash>.instance.CancelDash(); } } [HarmonyPrefix] [HarmonyPatch(typeof(AlwaysLookAtCamera), "LateUpdate")] public static void ReplacedualWieldIcon(AlwaysLookAtCamera __instance) { if (!tcenabled) { return; } SpriteRenderer val = default(SpriteRenderer); DualWieldNewIcon dualWieldNewIcon = default(DualWieldNewIcon); SpriteRenderer val2 = default(SpriteRenderer); DualWieldNewIcon dualWieldNewIcon2 = default(DualWieldNewIcon); if (((Component)((Component)__instance).transform).TryGetComponent<SpriteRenderer>(ref val) && !((Component)((Component)__instance).transform).TryGetComponent<DualWieldNewIcon>(ref dualWieldNewIcon)) { if ((Object)(object)val.sprite != (Object)null && ((Object)val.sprite).name == "dualwieldpowerup") { val.sprite = MainCode.FetchFromBundle<Sprite>("Textures/dualwieldpowerup.png", autofill: true); ((Component)__instance).gameObject.AddComponent<DualWieldNewIcon>(); } } else if (((Component)__instance).transform.childCount > 0 && ((Component)((Component)__instance).transform.GetChild(0)).TryGetComponent<SpriteRenderer>(ref val2) && !((Component)((Component)__instance).transform.GetChild(0)).TryGetComponent<DualWieldNewIcon>(ref dualWieldNewIcon2) && (Object)(object)val2.sprite != (Object)null && ((Object)val2.sprite).name == "dualwieldpowerup") { val2.sprite = MainCode.FetchFromBundle<Sprite>("Textures/dualwieldpowerup.png", autofill: true); ((Component)((Component)__instance).transform.GetChild(0)).gameObject.AddComponent<DualWieldNewIcon>(); } } [HarmonyPrefix] [HarmonyPatch(typeof(DifficultyTitle), "Check")] public static bool addStrayModeToDifficulty(DifficultyTitle __instance) { if (!tcenabled) { return true; } int @int = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0); string text = ""; if (__instance.lines) { text += "-- "; } if (@int < 5) { text += "<color=yellow>STRAYMODE</color> "; } switch (@int) { case 0: text += "HARMLESS"; break; case 1: text += "LENIENT"; break; case 2: text += "STANDARD"; break; case 3: text += "VIOLENT"; break; case 4: text += "BRUTAL"; break; case 5: text += "<color=yellow>STRAYMODE</color> MUST DIE"; break; } if (__instance.lines) { text += " --"; } if (!Object.op_Implicit((Object)(object)__instance.txt2)) { __instance.txt2 = ((Component)__instance).GetComponent<TMP_Text>(); } if (Object.op_Implicit((Object)(object)__instance.txt2)) { __instance.txt2.text = text; return false; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(LevelSelectPanel), "Setup")] public static void SetLevelIcons(LevelSelectPanel __instance) { if (tcenabled) { bool flag = false; if ((Object)(object)__instance.origSprite == (Object)null) { __instance.origSprite = ((Component)((Component)__instance).transform.Find("Image")).GetComponent<Image>().sprite; } switch (((Object)__instance.origSprite).name) { case "4-4 Clair de Soleil": flag = true; break; case "2-4 Court of the Corpse King": flag = true; break; case "1-4 Clair de Lune": flag = true; break; } if (flag) { __instance.origSprite = MainCode.FetchFromBundle<Sprite>("MapMods/MapIcons/" + ((Object)__instance.origSprite).name + ".png", autofill: true); } } } [HarmonyPostfix] [HarmonyPatch(typeof(SaveSlotMenu), "ReloadMenu")] [HarmonyPatch(typeof(SaveSlotMenu), "SelectSlot")] [HarmonyPatch(typeof(SaveSlotMenu), "ConfirmReload")] [HarmonyPatch(typeof(SaveSlotMenu), "ConfirmWipe")] [HarmonyPatch(typeof(SaveSlotMenu), "OnEnable")] private static void ResetMenu() { updatedMenu = false; DisplayMenuPopup = false; } [HarmonyPostfix] [HarmonyPatch(typeof(SaveSlotMenu), "OnEnable")] private static void GabeSlotMaker(SaveSlotMenu __instance) { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) updatedMenu = false; DisplayMenuPopup = false; bool flag = false; for (int i = 0; i < __instance.slots.Length; i++) { if (__instance.slots[i].slotNumberLabel.text == "STRAYMODE") { flag = true; } } if (!flag) { SlotRowPanel newRow = Object.Instantiate<SlotRowPanel>(__instance.templateRow, ((Component)__instance.templateRow).transform.parent); newRow.slotIndex = 1015064006; ((Component)newRow).gameObject.SetActive(true); __instance.UpdateSlotState(newRow, GetSlot(1015064006)); ((UnityEvent)newRow.selectButton.onClick).AddListener((UnityAction)delegate { __instance.SelectSlot(newRow.slotIndex); }); ((UnityEvent)newRow.deleteButton.onClick).AddListener((UnityAction)delegate { __instance.ClearSlot(newRow.slotIndex); }); ((Graphic)newRow.slotNumberLabel).color = Color.yellow; newRow.slotNumberLabel.text = "STRAYMODE"; List<SlotRowPanel> list = new List<SlotRowPanel>(); list.AddRange(__instance.slots); list.Add(newRow); __instance.slots = list.ToArray(); } } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Start")] private static void MovementSoundPatch(NewMovement __instance) { //IL_02a6: 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) if (MonoSingleton<PrefsManager>.Instance.GetInt("selectedSaveSlot", 0) == 1015064006) { GameProgressMoneyAndGear generalProgress = GameProgressSaver.GetGeneralProgress(); generalProgress.revalt = 0; generalProgress.sho2 = 0; generalProgress.rev1 = 0; generalProgress.nai2 = 0; generalProgress.nai3 = 0; generalProgress.naialt = 0; if (Debugging) { generalProgress.beam0 = 0; } generalProgress.beam1 = 0; generalProgress.beam2 = 0; generalProgress.beam3 = 0; generalProgress.rai1 = 0; generalProgress.rai3 = 0; generalProgress.rock2 = 0; generalProgress.rock3 = 0; generalProgress.shoalt = 0; GameProgressSaver.WriteFile(GameProgressSaver.generalProgressPath, (object)generalProgress); switch (SceneHelper.CurrentScene) { case "Level 0-S": __instance.cc.cam.useOcclusionCulling = false; break; case "Level 1-4": __instance.cc.cam.useOcclusionCulling = false; break; case "CreditsMuseum2": __instance.cc.cam.useOcclusionCulling = false; break; } ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Health Slider")).GetComponent<Slider>().maxValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/AntiHealth Slider")).GetComponent<Slider>().minValue = 19f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent<Slider>().minValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent<Slider>().maxValue = 160f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3")).gameObject.SetActive(false); ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill/ReadyFlash")).GetComponent<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Background")).GetComponent<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent<Image>().pixelsPerUnitMultiplier = 5.4f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent<Image>().type = (Type)1; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent<Image>().fillCenter = true; ((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)").localPosition = new Vector3(46.6357f, -18f, 0f); ((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)").localScale = new Vector3(1.5f, 1f, 1f); ((Behaviour)((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)")).GetComponent<Image>()).enabled = false; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel")).GetComponent<Image>().sprite = MainCode.FetchFromBundle<Sprite>("Textures/UI/lightningboltbigvector.png", autofill: true); ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel (2)")).GetComponent<Image>().sprite = MainCode.FetchFromBundle<Sprite>("Textures/UI/lightningboltbigvector.png", autofill: true); ReplaceLevels(); CheckSuperDashEquipped(); } } [HarmonyPrefix] [HarmonyPatch(typeof(HealthBar), "Update")] private static bool HealthBarUpdate(HealthBar __instance) { //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (__instance.hp < (float)__instance.nmov.hp) { __instance.hp = Mathf.MoveTowards(__instance.hp, (float)__instance.nmov.hp, Time.deltaTime * (((float)__instance.nmov.hp - __instance.hp) * 5f + 5f)); } else if (__instance.hp > (float)__instance.nmov.hp) { __instance.hp = __instance.nmov.hp; } if (__instance.hpSliders.Length != 0) { Slider[] hpSliders = __instance.hpSliders; foreach (Slider val in hpSliders) { if (val.value != __instance.hp) { val.value = __instance.hp; } } } if (__instance.afterImageSliders != null) { Slider[] hpSliders = __instance.afterImageSliders; foreach (Slider val2 in hpSliders) { if (val2.value < __instance.hp) { val2.value = __instance.hp; } else if (val2.value > __instance.hp) { val2.value = Mathf.MoveTowards(val2.value, __instance.hp, Time.deltaTime * ((val2.value - __instance.hp) * 5f + 5f)); } } } if ((Object)(object)__instance.antiHpSlider != (Object)null) { if (__instance.antiHpSlider.value != __instance.nmov.antiHp) { __instance.antiHpSlider.value = Mathf.MoveTowards(__instance.antiHpSlider.value, __instance.nmov.antiHp, Time.deltaTime * (Mathf.Abs(__instance.antiHpSlider.value - __instance.nmov.antiHp) * 5f + 5f)); } if ((Object)(object)__instance.antiHpSliderFill != (Object)null) { ((Behaviour)__instance.antiHpSliderFill).enabled = __instance.antiHpSlider.value > 0f; } } if ((Object)(object)__instance.hpText != (Object)null) { if (!__instance.antiHpText) { if (__instance.lastHP != __instance.hp) { __instance.hpText.text = __instance.hp.ToString("F0"); __instance.lastHP = __instance.hp; } if (__instance.changeTextColor) { if (__instance.hp <= 30f) { ((Graphic)__instance.hpText).color = Color.red; return false; } if (__instance.hp <= 50f && __instance.yellowColor) { ((Graphic)__instance.hpText).color = Color.yellow; return false; } ((Graphic)__instance.hpText).color = __instance.normalTextColor; return false; } if (__instance.normalTextColor == Color.white) { if (__instance.hp <= 40f) { ((Graphic)__instance.hpText).color = Color.red; return false; } ((Graphic)__instance.hpText).color = __instance.colorBlindSettings.GetHudColor((HudColorType)4); return false; } } else { if (__instance.difficulty == 0) { __instance.hpText.text = "/160"; return false; } __instance.antiHp = Mathf.MoveTowards(__instance.antiHp, __instance.nmov.antiHp, Time.deltaTime * (Mathf.Abs(__instance.antiHp - __instance.nmov.antiHp) * 5f + 5f)); __instance.antiHp = Mathf.Clamp(__instance.antiHp, 20f, 80f); float num = 100f - __instance.antiHp; if (__instance.lastAntiHP != num) { __instance.hpText.text = "/" + num.ToString("F0"); __instance.lastAntiHP = num; } } } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(Punch), "ParryProjectile")] private static void CustomParries(Punch __instance, Projectile proj) { CustomParryProjectile customParryProjectile = default(CustomParryProjectile); if (((Component)proj).TryGetComponent<CustomParryProjectile>(ref customParryProjectile)) { customParryProjectile.GetParried(); } } [HarmonyPrefix] [HarmonyPatch(typeof(WeaponPickUp), "GotActivated")] public static void FixPickups(WeaponPickUp __instance) { if (!tcenabled) { return; } GameObject[] array = null; GameObject val = null; if ((Object)(object)__instance.weapon != (Object)null) { string name = ((Object)__instance.weapon).name; if (name != null) { if (name.Contains("Shotgun") && !name.Contains("ShotgunWeapon")) { string text = ((Object)__instance.weapon).name.Replace("Shotgun ", ""); if (text != null) { if (text.Contains("Grenade")) { array = GetWeapon("LaserCore"); } else if (text.Contains("Pump")) { array = GetWeapon("LaserOC"); } } } else if (name.Contains("Nailgun")) { string text2 = ((Object)__instance.weapon).name.Replace("Nailgun ", ""); if (text2 != null) { if (text2.Contains("Magnet")) { array = GetWeapon("SwordC"); } else if (text2.Contains("Overheat")) { array = GetWeapon("SwordT"); } } } else if (name.Contains("ShotgunWeapon")) { array = GetWeapon("VDC"); } else if (name.Contains("Railcannon")) { string text3 = ((Object)__instance.weapon).name.Replace("Railcannon ", ""); if (text3 != null) { if (text3.Contains("Electric")) { array = GetWeapon("VDC"); } else if (text3.Contains("Malicious")) { array = GetWeapon("MDC"); } } } else if (name.Contains("Revolver") && SceneHelper.CurrentScene != "Level 0-1") { string text4 = ((Object)__instance.weapon).name.Replace("Revolver ", ""); if (text4 != null) { if (text4.Contains("Pierce")) { array = GetWeapon("ArmPierce"); } else if (text4.Contains("Ricochet")) { array = GetWeapon("ArmMarks"); } } } } } if (array != null) { val = ((!((Object)__instance.weapon).name.Contains("Alter")) ? array[0] : array[1]); if ((Object)(object)val != (Object)null) { __instance.weapon = val; } } } [HarmonyPrefix] [HarmonyPatch(typeof(Bonus), "OnTriggerEnter")] public static bool FixOverheal(Bonus __instance, Collider other) { //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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Invalid comparison between Unknown and I4 //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (((Component)other).gameObject.CompareTag("Player") && !__instance.activated) { if (!__instance.ghost) { __instance.activated = true; MonoSingleton<TimeController>.Instance.ParryFlash(); StyleHUD instance = MonoSingleton<StyleHUD>.Instance; StatsManager instance2 = MonoSingleton<StatsManager>.Instance; Object.Instantiate<GameObject>(__instance.breakEffect, ((Component)__instance).transform.position, Quaternion.identity); instance.AddPoints(0, "ultrakill.secret", (GameObject)null, (EnemyIdentifier)null, -1, "", ""); instance2.secrets++; instance2.SecretFound(__instance.secretNumber); Object.Destroy((Object)(object)((Component)__instance).gameObject); } else { if (__instance.tutorial) { MonoSingleton<TimeController>.Instance.ParryFlash(); } Object.Instantiate<GameObject>(__instance.breakEffect, ((Component)__instance).transform.position, Quaternion.identity); Object.Destroy((Object)(object)((Component)__instance).gameObject); } if (__instance.superCharge) { if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 0) { overhealed = true; MonoSingleton<NewMovement>.Instance.hp = 160; } else { MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(2); } if (!MonoSingleton<PrefsManager>.Instance.GetBool("hideSuperChargePopup", false)) { MonoSingleton<PrefsManager>.Instance.SetBool("hideSuperChargePopup", true); MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("<color=red>RED SOUL ORBS</color> give <color=green>200 HEALTH</color>. \nOverheal cannot be regained with blood.", "", "", 1, false, false, true); } } else if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(1); } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(IntroTextController), "Awake")] public static void replaceTutorialText(IntroTextController __instance) { } [HarmonyPostfix] [HarmonyPatch(typeof(GunControl), "UpdateWeaponList")] public static void ReplaceWeaponsCaller(GunControl __instance) { _ = tcenabled; } [HarmonyPrefix] [HarmonyPatch(typeof(GunSetter), "ResetWeapons")] public static bool WeaponOverride(GunSetter __instance, bool firstTime = false) { if (!tcenabled) { return true; } if ((Object)(object)__instance.gunc == (Object)null) { __instance.gunc = ((Component)__instance).GetComponent<GunControl>(); } int num = 5; for (int i = 0; i < Mathf.Min(__instance.gunc.slots.Count, num); i++) { List<GameObject> list = __instance.gunc.slots[i]; foreach (GameObject item in list) { Object.Destroy((Object)(object)item); } list.Clear(); } List<int> list2 = __instance.CheckWeaponOrder("rev"); for (int j = 1; j < 5; j++) { switch (list2.IndexOf(j)) { case 0: __instance.CheckWeapon("rev0", __instance.gunc.slot1, GetWeapon("ArmPierce")); break; case 2: __instance.CheckWeapon("rev2", __instance.gunc.slot1, GetWeapon("ArmMarks")); break; case 1: __instance.CheckWeapon("rev1", __instance.gunc.slot1, GetWeapon("Arm3")); break; } } list2 = __instance.CheckWeaponOrder("sho"); for (int k = 1; k < 5; k++) { switch (list2.IndexOf(k)) { case 0: __instance.CheckWeapon("sho0", __instance.gunc.slot2, GetWeapon("LaserCore")); break; case 1: __instance.CheckWeapon("sho1", __instance.gunc.slot2, GetWeapon("LaserOC")); break; case 2: __instance.CheckWeapon("sho2", __instance.gunc.slot2, GetWeapon("Laser3")); break; } } list2 = __instance.CheckWeaponOrder("nai"); for (int l = 1; l < 5; l++) { switch (list2.IndexOf(l)) { case 0: __instance.CheckWeapon("nai0", __instance.gunc.slot3, GetWeapon("SwordC")); break; case 1: __instance.CheckWeapon("nai1", __instance.gunc.slot3, GetWeapon("SwordT")); break; case 2: __instance.CheckWeapon("nai2", __instance.gunc.slot3, GetWeapon("Sword3")); break; } } list2 = __instance.CheckWeaponOrder("rai"); for (int m = 1; m < 5; m++) { switch (list2.IndexOf(m)) { case 0: __instance.CheckWeapon("rai0", __instance.gunc.slot4, GetWeapon("VDC")); break; case 1: __instance.CheckWeapon("rai1", __instance.gunc.slot4, AddressablesExtensions.ToAssets(__instance.railHarpoon)); break; case 2: __instance.CheckWeapon("rai2", __instance.gunc.slot4, GetWeapon("MDC")); break; } } list2 = __instance.CheckWeaponOrder("rock"); for (int n = 1; n < 5; n++) { switch (list2.IndexOf(n)) { case 0: __instance.CheckWeapon("rock0", __instance.gunc.slot5, GetWeapon("Anch")); break; case 1: __instance.CheckWeapon("rock1", __instance.gunc.slot5, GetWeapon("Anch2")); break; case 2: __instance.CheckWeapon("rock2", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketRed)); break; } } __instance.gunc.UpdateWeaponList(firstTime); if ((Object)(object)__instance.gunc.currentWeapon == (Object)null && ((Component)__instance.gunc).transform.childCount > 0 && !MonoSingleton<FistControl>.Instance.shopping) { __instance.gunc.ForceWeapon(((Component)((Component)__instance.gunc).transform.GetChild(0)).gameObject, true); __instance.gunc.UpdateWeaponIcon(false); } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(StyleHUD), "Update")] public static void NullFreshnessFix(StyleHUD __instance) { if (!tcenabled) { return; } Dictionary<GameObject, float> dictionary = new Dictionary<GameObject, float>(); foreach (KeyValuePair<GameObject, float> item in __instance.weaponFreshness) { if ((Object)(object)item.Key == (Object)null) { dictionary.Add(item.Key, item.Value); } } foreach (KeyValuePair<GameObject, float> item2 in dictionary) { __instance.weaponFreshness.Remove(item2.Key); } } [HarmonyPrefix] [HarmonyPatch(typeof(GunSetter), "ForceWeapon")] public static bool ForceWeaponOverride(GunSetter __instance, string weaponName) { if (!tcenabled) { return true; } if ((Object)(object)__instance.gunc == (Object)null) { __instance.gunc = ((Component)__instance).GetComponent<GunControl>(); } int num = 0; if (MonoSingleton<PrefsManager>.Instance.GetInt("weapon." + weaponName, 0) == 2) { num = 1; } switch (weaponName) { case "rev0": __instance.gunc.ForceWeapon(GetWeapon("ArmPierce")[num], true); break; case "rev2": __instance.gunc.ForceWeapon(GetWeapon("ArmMarks")[num], true); break; case "rev1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.revolverTwirl[num]), true); break; case "sho0": __instance.gunc.ForceWeapon(GetWeapon("LaserCore")[num], true); break; case "sho1": __instance.gunc.ForceWeapon(GetWeapon("LaserOC")[num], true); break; case "sho2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.shotgunRed[num]), true); break; case "nai0": __instance.gunc.ForceWeapon(GetWeapon("SwordC")[num], true); break; case "nai1": __instance.gunc.ForceWeapon(GetWeapon("SwordT")[num], true); break; case "nai2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.nailRed[num]), true); break; case "rai0": __instance.gunc.ForceWeapon(GetWeapon("VDC")[num], true); break; case "rai1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.railHarpoon[num]), true); break; case "rai2": __instance.gunc.ForceWeapon(GetWeapon("MDC")[num], true); break; case "rock0": __instance.gunc.ForceWeapon(GetWeapon("Anch")[num], true); break; case "rock1": __instance.gunc.ForceWeapon(GetWeapon("Anch2")[num], true); break; case "rock2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.rocketRed[num]), true); break; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(ShopZone), "TurnOff")] public static void FixRevolverAnomaly() { if (tcenabled && Object.op_Implicit((Object)(object)MonoSingleton<GunSetter>.Instance)) { MonoSingleton<GunSetter>.Instance.ResetWeapons(false); } } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "ResetFists")] public static bool resetFistsPatch(FistControl __instance) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (__instance.spawnedArms.Count > 0) { for (int i = 0; i < __instance.spawnedArms.Count; i++) { Object.Destroy((Object)(object)__instance.spawnedArms[i]); } __instance.spawnedArms.Clear(); __instance.spawnedArmNums.Clear(); } if ((MonoSingleton<PrefsManager>.Instance.GetInt("weapon.arm0", 1) == 1 && (__instance.forcedLoadout == null || (int)__instance.forcedLoadout.arm.blueVariant == 0)) || (__instance.forcedLoadout != null && (int)__instance.forcedLoadout.arm.blueVariant == 1)) { GameObject item = Object.Instantiate<GameObject>(bluearm, ((Component)__instance).transform); __instance.spawnedArms.Add(item); __instance.spawnedArmNums.Add(0); } __instance.CheckFist("arm1"); __instance.CheckFist("arm2"); __instance.CheckFist("arm3"); if (__instance.spawnedArms.Count <= 1 || !MonoSingleton<PrefsManager>.Instance.GetBool("armIcons", false)) { GameObject[] fistPanels = __instance.fistPanels; for (int j = 0; j < fistPanels.Length; j++) { fistPanels[j].SetActive(false); } } else { GameObject[] fistPanels2 = __instance.fistPanels; for (int k = 0; k < fistPanels2.Length; k++) { fistPanels2[k].SetActive(true); } } __instance.ForceArm(__instance.currentVarNum, false); __instance.UpdateFistIcon(); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "CheckFist")] public static bool checkFistsPatch(FistControl __instance, string name) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 if (!tcenabled) { return true; } if (__instance.forcedLoadout != null) { if (!(name == "arm2")) { if (name == "arm1") { if ((int)__instance.forcedLoadout.arm.redVariant == 1) { __instance.spawnedArmNums.Add(1); GameObject val = Object.Instantiate<GameObject>(redarm, ((Component)__instance).transform); val.AddComponent<StraymodeWeaponID>(); __instance.spawnedArms.Add(val); return false; } if ((int)__instance.forcedLoadout.arm.redVariant == 2) { return false; } } } else { if ((int)__instance.forcedLoadout.arm.greenVariant == 1) { MonoSingleton<HookArm>.Instance.equipped = true; return false; } if ((int)__instance.forcedLoadout.arm.greenVariant == 2) { return false; } } } if (MonoSingleton<PrefsManager>.Instance.GetInt("weapon." + name, 1) == 1 && GameProgressSaver.CheckGear(name) == 1) { GameObject val2 = null; switch (name) { case "arm1": val2 = Object.Instantiate<GameObject>(redarm, ((Component)__instance).transform); val2.AddComponent<StraymodeWeaponID>(); __instance.spawnedArmNums.Add(1); break; case "arm2": MonoSingleton<HookArm>.Instance.equipped = true; break; case "arm3": val2 = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.goldArm), ((Component)__instance).transform); __instance.spawnedArmNums.Add(3); break; } if ((Object)(object)val2 != (Object)null) { __instance.spawnedArms.Add(val2); } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void RemoveAct3(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Act III") { __instance.forceOff = true; } } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void UnlockEncores(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name.ToLower().Contains("encore")) { __instance.requiredLevels = 20; } } [HarmonyPrefix] [HarmonyPatch(typeof(LayerSelect), "Awake")] public static void RemoveHeresy(LayerSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Layer 6 Heresy" && SceneHelper.CurrentScene == "Main Menu") { ((Component)((Component)__instance).transform.Find("Level Row/1-2 Panel")).gameObject.SetActive(false); if (__instance.childLeaderboards != null && __instance.childLeaderboards.Length != 0) { __instance.childLeaderboards = (LevelSelectLeaderboard[])(object)new LevelSelectLeaderboard[1] { __instance.childLeaderboards[0] }; } __instance.levelAmount = 1; } } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void RemoveHeresy2(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Act II" && SceneHelper.CurrentScene == "Main Menu") { __instance.requiredLevels = 14; } } [HarmonyPrefix] [HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")] [HarmonyPatch(typeof(LeaderboardController), "SubmitCyberGrindScore")] private static bool DisableLeaderboardSubmissions() { return false; } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Respawn")] public static void ResetWeaponsStuff() { if (tcenabled) { ResetAllAmmos(ResetWeaponsToo: true, resetShoCharge: true); } } [HarmonyPostfix] [HarmonyPatch(typeof(WeaponCharges), "MaxCharges")] public static void ResetWeaponsStuff2() { if (tcenabled) { ResetAllAmmos(ResetWeaponsToo: false); } } public static void ResetAllAmmos(bool ResetWeaponsToo = true, bool resetShoCharge = false) { if (charges.ContainsKey("anc1charge") && !NoWeaponCooldown.NoCooldown) { charges["anc1charge"].amt = 6f; freezeAnchors = false; } foreach (KeyValuePair<string, Charge> charge in charges) { charge.Value.Reset(NoWeaponCooldown.NoCooldown); } if (!ResetWeaponsToo) { return; } foreach (StrayGun armgun in armguns) { armgun.Reset(); } foreach (StrayLaserGun lasergun in laserguns) { lasergun.Reset(); } foreach (Anchor anchor in anchors) { anchor.Reset(); } if (Object.FindObjectsOfType<Anchor_PhysicsSim>() != null) { Anchor_PhysicsSim[] array = Object.FindObjectsOfType<Anchor_PhysicsSim>(); for (int i = 0; i < array.Length; i++) { array[i].Pull(); } } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerActivator), "OnTriggerEnter")] public static void Skip01Thing(PlayerActivator __instance, Collider other) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (tcenabled && ((Component)other).gameObject.CompareTag("Player")) { if (SceneHelper.CurrentScene == "Level 0-1" && !__instance.activated && canTeleportPlayer) { ((Component)MonoSingleton<NewMovement>.instance).transform.position = new Vector3(40f, 0f, 380f); canTeleportPlayer = false; } if (SceneHelper.CurrentScene == "Tutorial" && !__instance.activated) { MonoSingleton<PrefsManager>.instance.SetInt("ShoUseTut", 0); } if (SceneHelper.CurrentScene == "Level 4-1" && !__instance.activated) { MonoSingleton<PrefsManager>.instance.SetInt("DualRageTut", 0); } } } [HarmonyPrefix] [HarmonyPatch(typeof(RevolverAnimationReceiver), "Click")] public static bool ClickFix(RevolverAnimationReceiver __instance) { if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (((Component)__instance).TryGetComponent<StraymodeWeaponID>(ref straymodeWeaponID)) { if (Object.op_Implicit((Object)(object)__instance.click)) { AudioSource component = Object.Instantiate<GameObject>(__instance.click).GetComponent<AudioSource>(); component.pitch += Random.Range(-0.075f, 0.075f); } return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(GunControl), "ForceWeapon")] public static bool WeaponScriptsAdder(GunControl __instance, GameObject weapon, bool setActive = true) { if (!tcenabled) { return true; } new List<GameObject>(); foreach (List<GameObject> slot in __instance.slots) { for (int i = 0; i < slot.Count; i++) { if (((Object)slot[i]).name == ((Object)weapon).name + "(Clone)" || ((Object)slot[i]).name == ((Object)weapon).name) { if ((Object)(object)__instance.currentWeapon != (Object)null) { __instance.currentWeapon.SetActive(false); } __instance.currentSlotIndex = __instance.slots.IndexOf(slot) + 1; __instance.currentVariationIndex = i; __instance.RetainVariation(__instance.currentSlotIndex - 1, __instance.currentVariationIndex); __instance.currentWeapon = slot[__instance.currentVariationIndex]; if (setActive) { __instance.currentWeapon.SetActive(true); } __instance.aud.Play(); break; } } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(CoinActivated), "OnTriggerEnter")] public static void Fix11Thing(CoinActivated __instance, Collider other) { ItemIdentifier val = default(ItemIdentifier); if (tcenabled && ((Object)((Component)other).transform).name.Contains("Coin") && ((Component)other).TryGetComponent<ItemIdentifier>(ref val)) { __instance.events.Invoke(""); ((Component)other).gameObject.SetActive(false); ((Component)__instance).GetComponent<Collider>().enabled = false; } } } [HarmonyPatch] public class TerminalPatches { public static int gabrielsPlaceInTheSpawnerArmMenu; public static SpawnableObject gabe; public static void ReplaceWeaponIconAndDesc(Transform t, string name, string desc, WeaponDescriptor icon, int var, float newFontSize = -1f) { ((Component)t.GetChild(2)).GetComponent<TextMeshProUGUI>(); Transform child = t.GetChild(1); Transform parent = t.parent.parent.parent; ((Component)child).GetComponent<Image>().sprite = icon.icon; string text = ""; switch (var) { case 0: text = "Blue"; break; case 1: text = "Green"; break; case 2: text = "Red"; break; } Transform val = parent.Find("Variation Info (" + text + ")").Find("Panel"); ((TMP_Text)((Component)parent.Find("Variation Info (" + text + ")/Title")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)val.Find("Name")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)val.Find("Description")).GetComponent<TextMeshProUGUI>()).text = desc; if (newFontSize != -1f) { ((TMP_Text)((Component)val.Find("Description")).GetComponent<TextMeshProUGUI>()).fontSize = newFontSize; } ((Component)val.Find("Icon Inset/Icon")).GetComponent<Image>().sprite = ((Component)child).GetComponent<Image>().sprite; } public static void ReplaceWeaponInfo(Transform t, string name, string desc, GameObject newModel = null) { Transform parent = t.parent.parent.parent; Transform val = parent.Find("Info Screen"); Transform obj = parent.Find("Variation Screen"); ((TMP_Text)((Component)val.Find("Title")).GetComponent<TextMeshProUGUI>()).text = name + " Info"; ((TMP_Text)((Component)obj.Find("Title")).GetComponent<TextMeshProUGUI>()).text = name; Transform obj2 = val.Find("Main Window"); ((TMP_Text)((Component)obj2.Find("Name")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)obj2.Find("Scroll View/Viewport/Text")).GetComponent<TextMeshProUGUI>()).text = desc; ((Component)obj2.Find("Preview Window/Weapon Model")).gameObject.SetActive(false); } public static void ApplyModificationToIcon(Transform t, string name = "???", Transform descTransform = null, Sprite icon = null, string desc = "") { //IL_001a: 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_00b5: 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_00fd: Unknown result type (might be due to invalid IL or missing references) ((Component)t.Find("Equipment")).GetComponent<RectTransform>().offsetMax = new Vector2(-255f, -10f); ((Component)t.Find("Equipment")).GetComponent<RectTransform>().SetSizeWithCurrentAnchors((Axis)0, 70f); ((TMP_Text)((Component)t.Find("Variation Name")).GetComponent<TextMeshProUGUI>()).text = name; ((Component)t.Find("Weapon Icon")).gameObject.SetActive(false); ((Component)descTransform).GetComponent<RectTransform>().offsetMin = new Vector2(212.5f, 0f); ((Component)descTransform.Find("Panel/Icon Inset")).gameObject.SetActive(false); ((Component)descTransform.Find("Panel/Name")).GetComponent<RectTransform>().offsetMin = new Vector2(0f, -10f); ((Component)descTransform.Find("Panel/Description")).GetComponent<RectTransform>().offsetMin = new Vector2(0f, -10f); ((Component)descTransform.Find("Panel/Description")).GetComponent<RectTransform>().offsetMax = new Vector2(0f, -65f); ((TMP_Text)((Component)descTransform.Find("Panel/Name")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)descTransform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)descTransform.Find("Panel/Description")).GetComponent<TextMeshProUGUI>()).text = desc; ((Component)descTransform.Find("Panel/Purchase Button")).gameObject.SetActive(false); } [HarmonyPrefix] [HarmonyPatch(typeof(ShopZone), "Start")] public static void WaresPatch(ShopZone __instance) { //IL_0092: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown if (!tcenabled || GameProgressSaver.CheckGear("beam0") == 0) { return; } Transform obj = ((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Weapons Panel/Buttons/ArmButton"); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); if (!Object.op_Implicit((Object)(object)val)) { return; } RectTransform component = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Weapons Panel/Buttons")).GetComponent<RectTransform>(); ShopButton component2 = Object.Instantiate<GameObject>(val, val.transform.parent).GetComponent<ShopButton>(); Object.Destroy((Object)(object)((Component)component2).GetComponent<ShopCategory>()); ((Component)component2).gameObject.SetActive(true); RectTransform component3 = ((Component)component2).GetComponent<RectTransform>(); component.offsetMax = new Vector2(-10f, -95f); component3.anchoredPosition = new Vector2(0f, -210f); ((TMP_Text)((Component)component2).GetComponentInChildren<TextMeshProUGUI>()).text = "Wares"; GameObject gameObject = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject; GameObject val2 = Object.Instantiate<GameObject>(gameObject, gameObject.transform.parent); ShopButton[] componentsInChildren = ((Component)component).GetComponentsInChildren<ShopButton>(true); foreach (ShopButton val3 in componentsInChildren) { if (!((Object)(object)val3 == (Object)(object)component2)) { List<GameObject> list = val3.toDeactivate.ToList(); list.Add(val2); val3.toDeactivate = list.ToArray(); } } component2.toActivate[0] = val2; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Blue)")).name = "Ware Panel (Blue)"; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Red)")).name = "Ware Panel (Red)"; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Green)")).name = "Ware Panel (Green)"; ((Component)val2.transform.Find("Variation Screen/Variations/Arm Panel (Gold)")).gameObject.SetActive(false); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)")).GetComponent<VariationInfo>().weaponName = "beam0"; ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Equipment Status")).GetComponent<ControllerPointer>().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Buttons/Previous Button")).GetComponent<ControllerPointer>().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Buttons/Next Button")).GetComponent<ControllerPointer>().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Red)")).GetComponent<VariationInfo>().weaponName = "beam1"; ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Green)")).GetComponent<VariationInfo>().weaponName = "beam2"; ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)"), "Withered Cloak", val2.transform.Find("Arm Info (Blue)"), null, "Third dash. 0.34 seconds of invincibility during dash. 2 second cooldown."); ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Green)"), "???", val2.transform.Find("Arm Info (Green)")); ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Red)"), "???", val2.transform.Find("Arm Info (Red)")); } [HarmonyPostfix] [HarmonyPatch(typeof(VariationInfo), "Start")] public static void ChangeWeaponDescriptions(VariationInfo __instance) { if (!new List<string> { "rev", "sho", "nai", "rai", "rock", "arm" }.Contains(__instance.weaponName.Replace("0", "").Replace("1", "").Replace("2", "") .Replace("3", "")) || !tcenabled) { return; } ReplaceWeaponName(((Component)((Component)__instance).transform.GetChild(2)).GetComponent<TextMeshProUGUI>()); ReplaceWeaponName(((Component)((Component)__instance).transform.parent.parent.Find("Title")).GetComponent<TextMeshProUGUI>()); if (__instance.weaponName.Contains("rev")) { string weaponName = __instance.weaponName; if (weaponName != null) { if (weaponName.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "PIERCING", "<color=orange>Primary fire</color>: Hold to fire. \r\n<color=orange>Alt fire</color>: Fire a bouncy, penetrating beam.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayPistol.asset", autofill: true), 0); } else if (weaponName.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "REFLECTOR", "<color=orange>Alt fire</color> to charge the last fired orb to make it reflect and boost projectiles shot into it. Charged orbs becomes <color=red>supercharged</color> for a short time, allowing for more combo potential.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayPistol Electric.asset", autofill: true), 1); } else if (weaponName.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Revolver Image!"); } if (__instance.weaponName.Contains("sho")) { string weaponName2 = __instance.weaponName; if (weaponName2 != null) { if (weaponName2.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "ENERGY GRENADE", "<color=orange>PRIMARY FIRE</color>: Fire shotgun pellets in a triangular pattern.\r\n<color=orange>ALTERNATE FIRE</color>: Launch a volley of three grenades using 75 ammo.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayLaserGun Alt.asset", autofill: true), 0); } else if (weaponName2.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "OVERCHARGE", "Shoot to slowly charge <color=orange>Alt fire</color>.\n<color=orange>Alt fire</color> fires a powerful, penetrating electricity beam.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayLaserGun Green Alt.asset", autofill: true), 1); } else if (weaponName2.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Shotgun Image!"); } if (__instance.weaponName.Contains("nai")) { string weaponName3 = __instance.weaponName; if (weaponName3 != null) { if (weaponName3.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "CHAINSWORD", "<color=orange>Primary fire</color>: Slash enemies.\r\nDamage is higher with your speed when hitting an enemy.\n<color=orange>Secondary fire</color>: Throw the sword. Thrown swords get stuck in <color=orange>Heavy enemies</color>.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StraySword.asset", autofill: true), 0); } else if (weaponName3.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "TELEFRAG", "<color=orange>Alt Fire (While looking at an enemy)</color>: Teleport into the enemy and slash them, dealing damage.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StraySword Tele.asset", autofill: true), 1); } else if (weaponName3.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Sword Image!"); } if (__instance.weaponName.Contains("rai")) { string weaponName4 = __instance.weaponName; if (weaponName4 != null) { if (weaponName4.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "V.D.C. CONFIG", "<color=orange>Primary fire</color>: Fire a powerful ball of energy. Projectile explodes on contact with terrain. Recharges even when not equipped.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayCannon.asset", autofill: true), 0); } else if (weaponName4.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "M.D.C. CONFIG", "<color=orange>Primary fire</color>: Fire a powerful, explosive ball of energy. Projectile explodes on contact with objects. Recharges even when not equipped.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayCannon Green.asset", autofill: true), 2); } else if (weaponName4.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Rail Image!"); } if (__instance.weaponName.Contains("rock")) { string weaponName5 = __instance.weaponName; if (weaponName5 != null) { if (weaponName5.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "FREEZEFRAME", "<color=orange>Primary fire</color>: Throw the Anchor. <color=orange>Hold</color> to charge for more velocity. Indirect hits launch enemies. Explodes <color=red>only</color> on contact with airborne enemies.\r\n<color=orange>Secondary fire</color>: Freeze the Anchor. <color=orange>Multiple frozen Anchors can be active at once</color>.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayAnchor.asset", autofill: true), 0, 18f); } else if (weaponName5.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "S.C.S.", "<color=orange>Secondary fire</color>: <color=orange>Hold</color> to charge. <color=orange>Release</color> to throw a supercharged anchor.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayAnchor Green.asset", autofill: true), 1); } else if (weaponName5.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Rock Image!"); } if (__instance.weaponName.Contains("arm")) { string weaponName6 = __instance.weaponName; if (weaponName6 != null && !weaponName6.Contains("0")) { if (weaponName6.Contains("1")) { ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Description")).GetComponent<TextMeshProUGUI>()).text = "Slow punch with high damage and knockback.\r\n\r\n<color=orange>Hold Punch</color> to launch the hammer forward, causing a <color=orange>shockwave</color> that knocks surrounding enemies away."; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Name")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Title")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.Find("Variation Name")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; } else { weaponName6.Contains("2"); } } Log("Replaced Arms Image!"); } bool flag = false; if (!GetWeaponName(__instance.weaponName, shortname: true)) { flag = true; } if (__instance.weaponName.Contains("rev") && __instance.weaponName.Contains("1")) { flag = true; } if (__instance.weaponName.Contains("rai") && __instance.weaponName.Contains("1")) { flag = true; } if (!__instance.weaponName.Contains("rev") && !__instance.weaponName.Contains("rai") && !__instance.weaponName.Contains("arm") && __instance.weaponName.Contains("2")) { flag = true; } if (flag && !Debugging) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } if (!__instance.weaponName.Contains("arm")) { ((Component)((Component)__instance).transform.parent.Find("Info and Color Panel/ColorButton")).gameObject.SetActive(false); } switch (__instance.weaponName.Replace("0", "").Replace("1", "").Replace("2", "") .Replace("3", "")) { case "rev": { string desc4 = "<color=#FF4343>DATA:</color>\r\nThe arm of a Stray, with cybernetically modified internals as to allow for carrying more weight. Due to prolonged contact with Hell energy, the flesh on the hand has withered away over time, revealing the bone.\r\n<color=#FF4343>STRATEGY:</color>\r\n- Primary fire throws fast orbs which pierce up to 3 enemies\r\n- <b>Primary fire orbs can be projectile boosted, turning them into a hitscan beam</b>\r\n<color=#00ffff>PIERCING:</color>\r\n- Alt fire throws a multi-hit beam which can pierce enemies infinitely and bounces off the environment\r\n<color=#00ff00>REFLECTOR</color>\r\n- Alt fire requires at least one primary fire orb to currently be active\r\n- Charges the last fired orb, turning it into a stationary <b>Reflector orb</b>, with similar mechanics to a <b>Coin</b>\r\n- Reflector orbs briefly <b>flash</b>, indicating their <b>Split window</b>, during which shooting at them will <b>split orbs</b> or <b>increase the damage of powerful projectiles</b>"; ReplaceWeaponInfo(((Component)__instance).transform, "Stray Arm", desc4); break; } case "sho": { string desc3 = "<color=#FF4343>DATA:</color>\r\nA crude device created from the corpses of Sentries, left by Machines who were only seeking their legs. Due to being salvaged from damaged parts, combined with parts of old War weapons, the weapon's batteries do not hold enough charge to continuously fire like the Revolvers can.\r\n<color=#FF4343>STRATEGY:</color>\r\n- Fires projectiles in a triangular spread, dealing a maximum of 2 damage per shot\r\n- Has a limited ammo pool, which recharges over time when not firing, even when not equipped\r\n<color=#00ffff>ENERGY GRENADE</color>\r\n- Alt fire fires a burst of three grenades, drawing from the ammo pool\r\n- Grenades can be shot with any hitscan attack\r\n- Grenades can be used in combos with the Reflector\r\n<color=#00ff00>OVERCHARGE</color>\r\n- Primary fire does not draw from ammo pool, but fires slower if Alt fire is ready to be used\r\n- Alt fire charged by firing <color=#00ff00>6 shots</color> <b>or</b> <color=#00ffff>3 shots</color>\r\n- Alt fire, when used, expends one battery\r\n- Two batteries are available, both of which recharge over time\r\n- Alt fire fires a piercing, multi-hit <b>electric</b> beam"; ReplaceWeaponInfo(((Component)__instance).transform, "Machineshotgun", desc3); break; } case "nai": { string text = "<color=#FF4343>DATA:</color>\r\nChainsaw sword created by an unknown scraphead, and modified by the <b>Swordscleaner</b> to allow for it to teleport back into its arsenal during and after combat. Through unknown means, it was reprogrammed to instead recall to <b>The Stray</b>.\r\n"; BestiaryData instance = MonoSingleton<BestiaryData>.Instance; if (instance != null && instance.GetEnemy((EnemyType)8) <= 0) { text = "<color=#FF4343>DATA:</color>\r\n<color=red>UNKNOWN. NO DATA</color>\r\n"; } text += "<color=#FF4343>STRATEGY:</color>\r\n<color=#00ffff>CHAINSWORD:</color>\r\n- Primary fire does damage depending on speed, but has a cooldown to match; <b>2.5:6:9</b> at <b>20:40:60</b> u/s, with a cooldown of <b>0:3.5:7</b> seconds.\r\n- Secondary fire throws the sword forward, with an 8 second cooldown.\r\n- Thrown swords pierce <b>LIGHT</b> enemies, and embed into <b>HEAVY</b> enemies.\r\n- Embedded swords do <b>8</b> damage over 8 seconds in intervals of 0.1 seconds, and can be manually recalled for an extra <b>2</b> damage.\r\n<color=green>TELEFRAG:</color>\r\n- Secondary fire teleports into the enemy you are aiming at, doing <b>2</b> damage plus <b>1</b> damage for every 10 units of initial distance to the enemy.\r\n<color=#FF4343>ADVANCED STRATEGY:</color>\r\n<color=green>TELEFRAG:</color>\r\n- Teleporting into enemies can be used to get out of sticky situations, such as if falling off the Cybergrind arena.\r\n- Teleporting into enemies can <color=orange>PARRY</color> them."; ReplaceWeaponInfo(((Component)__instance).transform, "Sword", text); break; } case "rai": { string desc2 = "<color=#FF4343>DATA:</color>\r\n<color=#666666>Under construction</color>\r\n<color=#FF4343>STRATEGY:</color>\r\n- Primary fire shoots a powerful <color=#00ffff>PIERCING</color>/<color=red>EXPLOSIVE</color> projectile, dealing <b>10</b> damage.\r\n- 16 second cooldown for firing.\r\n<color=#FF4343>ADVANCED STRATEGY:</color>\r\n- Projectile can be shot into <color=green>REFLECTOR</color> orbs, <color=#00ffff>REFLECTING FOR MORE DAMAGE</color> or <color=red>CREATING AN <b>11</b> DAMAGE EXPLOSION</color>"; ReplaceWeaponInfo(((Component)__instance).transform, "Displacement Cannon", desc2); break; } case "rock": { string desc = "<color=#FF4343>DATA:</color>\r\nAnchor, wrapped with leather for a stronger grip, wielded by the Young Ferryman and his group. Appears heavily worn from years of combat.\r\n<color=#FF4343>STRATEGY:</color>\r\n<color=#00ffff>FREEZEFRAME:</color>\r\nHold Primary fire to charge for higher velocity. Release to fire for <b>4</b> damage. Alt fire freezes all active Anchors, and allows for throwing multiple. Frozen anchors get <b>supercharged</b>, dealing a <b>7</b> damage red explosion upon hitting enemies.\r\nAnchors that hit the ground <b>launch</b> enemies into the air. Anchors that hit falling enemies create a <b>7</b> damage explosion.'\r\n<color=green>S.C.S:</color>\r\n Hold Alt fire to charge for higher velocity. Release to fire an <color=yellow>ENERGY</color> anchor for <b>6</b> damage. Energy anchors are destroyed when hitting the environment, and bounce off enemies.\r\n<color=#FF4343>ADVANCED STRATEGY:</color>\r\n<color=green>S.C.S</color>' Energy anchors can be shot with hitscans to create an explosion or whiplashed to pull them towards you. Energy anchors can be whiplashed or punched after bouncing off an enemy, allowing for <b>6</b> more damage."; ReplaceWeaponInfo(((Component)__instance).transform, "Anchor", desc); break; } } } public static void ReplaceWeaponName(TextMeshProUGUI nameText) { if (!tcenabled) { return; } string text = ((TMP_Text)nameText).text; if (text == null) { return; } switch (text.Length) { case 8: switch (text[0]) { case 'M': if (text == "MARKSMAN") { ((TMP_Text)nameText).text = "REFLECTOR"; } break; case 'S': if (text == "SAWED-ON") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'O': if (text == "OVERHEAT") { ((TMP_Text)nameText).text = "TELEFRAG"; } break; case 'E': if (text == "ELECTRIC") { ((TMP_Text)nameText).text = "V.D.C. CONFIG"; } break; } break; case 11: switch (text[1]) { case 'U': if (text == "PUMP CHARGE") { ((TMP_Text)nameText).text = "OVERCHARGE"; } break; case 'C': if (text == "SCREWDRIVER") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'R': if (text == "FREEZEFRAME") { ((TMP_Text)nameText).text = "FREEZEFRAME"; } break; case 'I': if (text == "FIRESTARTER") { ((TMP_Text)nameText).text = "INDEV"; } break; } break; case 9: switch (text[0]) { case 'A': if (text == "ATTRACTOR") { ((TMP_Text)nameText).text = "CHAINSWORD"; } break; case 'J': if (text == "JUMPSTART") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'M': if (text == "MALICIOUS") { ((TMP_Text)nameText).text = "M.D.C. CONFIG"; } break; } break; case 7: if (text == "PIERCER") { ((TMP_Text)nameText).text = "PIERCING"; } break; case 12: if (text == "SHARPSHOOTER") { ((TMP_Text)nameText).text = "INDEV"; } break; case 10: if (text == "CORE EJECT") { ((TMP_Text)nameText).text = "ENERGY GRENADE"; } break; case 13: if (text == "S.R.S. CANNON") { ((TMP_Text)nameText).text = "S.C.S. ANCHOR"; } break; } } [HarmonyPostfix] [HarmonyPatch(typeof(ShopCategory), "CheckGear")] public static void ChangeCategoryNames(ShopCategory __instance) { if (!tcenabled) { return; } if (!GetWeaponName(__instance.weaponName, shortname: true)) { if (!Debugging) { ((Component)__instance).gameObject.SetActive(false); } } else if (__instance.weaponName.Contains("rev")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "STRAY ARM"; } else if (__instance.weaponName.Contains("sho")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "MACHINE SHOTGUN"; } else if (__instance.weaponName.Contains("nai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "SWORD"; } else if (__instance.weaponName.Contains("rai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "DISPLACEMENT CANNON"; } else if (__instance.weaponName.Contains("rock")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "ANCHOR"; } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyInfoPage), "Start")] public static void UpdateInfoThingy(EnemyInfoPage __instance) { SpawnableObjectsDatabase objects = __instance.objects; bool flag = true; SpawnableObject[] enemies = objects.enemies; for (int i = 0; i < enemies.Length; i++) { if ((Object)(object)enemies[i] == (Object)(object)MainCode.FetchFromBundle<SpawnableObject>("PlayerStray_Terminal.asset", autofill: true)) { flag = false; } } if (flag) { SpawnableObject[] array = (SpawnableObject[])(object)new SpawnableObject[objects.enemies.Length + 1]; for (int j = 0; j < array.Length; j++) { if (j < 2) { array[j] = objects.enemies[j]; } if (j == 2) { array[j] = MainCode.FetchFromBundle<SpawnableObject>("PlayerStray_Terminal.asset", autofill: true); } if (j > 2) { array[j] = objects.enemies[j - 1]; } } objects.enemies = array; Log("Injected the Stray into Terminal!"); } if (!tcenabled) { return; } objects.enemies.ToList(); for (int k = 0; k < objects.enemies.Length; k++) { switch (objects.enemies[k].identifier) { case "ultrakill.v2": objects.enemies[k] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2Straymode.asset", autofill: true); break; case "ultrakill.v2_2": objects.enemies[k] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true); break; case "ultrakill.gabriel": objects.enemies[k] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Leph/leph.asset", autofill: true); break; } } } [HarmonyPrefix] [HarmonyPatch(typeof(SpawnMenu), "CreateButtons")] public static void ReplaceThings(SpawnMenu __instance, ref SpawnableObject[] list) { bool flag = false; int index = 0; for (int i = 0; i < list.Length; i++) { SpawnableObject val = list[i]; if ((Object)(object)val == (Object)null) { continue; } if (tcenabled) { if (val.identifier == "ultrakill.v2") { list[i] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2Straymode.asset", autofill: true); flag = true; } if (val.identifier == "ultrakill.v2_2") { list[i] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true); flag = true; } } else { if (val.identifier == "straymode.swordscleaner") { list[i] = Fetch<SpawnableObject>("Assets/Data/Sandbox/Enemies/Machine/V2.asset"); flag = true; } if (val.identifier == "straymode.swordscleaner2") { list[i] = Fetch<SpawnableObject>("Assets/Data/Sandbox/Enemies/Machine/V2 2nd.asset"); flag = true; } } if (val.identifier == "ultrakill.gabriel") { index = (gabrielsPlaceInTheSpawnerArmMenu = i); gabe = val; flag = true; } } if (!flag) { return; } List<SpawnableObject> list2 = list.ToList(); if (Debugging) { Log("pre List: " + string.Join("\r\n ", list2.Select((SpawnableObject obj) => $"{list2.IndexOf(obj)}: identifier: {obj.identifier}"))); } if (tcenabled) { list2.RemoveAt(index); } if (Debugging) { Log("post List: " + string.Join("\r\n ", list2.Select((SpawnableObject obj) => $"{list2.IndexOf(obj)}: identifier: {obj.identifier}"))); } if (!tcenabled) { list2.Add(MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true)); list2.Add(MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2Straymode.asset", autofill: true)); if (!list2.Contains(gabe) && (Object)(object)gabe != (Object)null) { list2.Insert(gabrielsPlaceInTheSpawnerArmMenu, gabe); } } list = list2.ToArray(); } } [HarmonyPatch] public class TipsOfTheDay { public static List<string> newTexts = new List<string> { "The <color=#40E7FF>Piercing</color> arm deals <color=orange>locational damage</color>.\r\n\r\nA <color=orange>headshot</color> deals <color=orange>2x</color> damage.\r\n", "<color=orange>Machine Shotgun mobility</color>:\nThe Machine Shotguns knock you back when firing.\nUse it to your advantage.", "Shooting <color=#40E7FF>SHOTGUN CORES</color> at <color=red>SUPERCHARGED</color> <color=green>REFLECTOR PROJECTILES</color> makes them explode.", "<color=#40E7FF>THROWN SWORDS</color> can get <color=orange>STUCK</color> in <color=orange>Heavy Enemies</color>.", "<color=red>HITSCAN</color> weapons can be used to hit the machine-shotgun's <color=#00ffff>GRENADES</color> in mid-air to increase damage and blast radius.", "The <color=#00ffff>Machine shotgun</color>'s grenade attack can be cancelled by swapping weapons, wasting less ammo.", "If blown too far off the arena, <color=#44FF45>OVERCHARGE</color>'s alt-fire is a good way to get back." }; [HarmonyPostfix] [HarmonyPatch(typeof(ShopZone), "Start")] public static void TipsFix(ShopZone __instance) { if (!tcenabled || !((Object)(object)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText") != (Object)null)) { return; } TextMeshProUGUI component = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText")).GetComponent<TextMeshProUGUI>(); string currentScene = SceneHelper.CurrentScene; if (currentScene == null) { return; } switch (currentScene.Length) { case 9: switch (currentScene[8]) { case '2': if (!(currentScene == "Level 0-2")) { if (currentScene == "Level 1-2") { ((TMP_Text)component).text = newTexts[2]; } } else { ((TMP_Text)component).text = newTexts[0]; } break; case '4': switch (currentScene) { case "Level 0-4": ((TMP_Text)component).text = newTexts[1]; break; case "Level 1-4": ((TMP_Text)component).text = newTexts[3]; break; case "Level 4-4": ((TMP_Text)component).text = newTexts[5]; break; } break; case '1': if (currentScene == "Level 4-1") { ((TMP_Text)component).text = newTexts[4]; } break; case '3': break; } break; case 7: if (currentScene == "Endless") { ((TMP_Text)component).text = newTexts[6]; } break; } } } public class StraymodeTargetable : MonoBehaviour { public EnemyIdentifier eid; public BlackHole hole; public Grenade gren; public Collider col; public bool targetable = true; public bool onlyCertainWeapons; public List<string> targetableWeapons = new List<string>(); private CameraController cc; public void FixedUpdate() { //IL_0106: 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_011c: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) bool flag = true; if (onlyCertainWeapons && (!targetableWeapons.Contains(((Object)MonoSingleton<GunControl>.Instance.currentWeapon).name.ToLower().Replace("(clone)", "")) || 1 == 0)) { targetable = false; return; } Transform val = ((Component)this).transform; if ((Object)(object)eid != (Object)null) { val = ((!((Object)(object)eid.weakPoint != (Object)null)) ? eid.GetCenter() : eid.weakPoint.transform); } if ((Object)(object)col == (Object)null && !((Component)val).TryGetComponent<Collider>(ref col)) { if ((Object)(object)((Component)val).GetComponentInChildren<Collider>() != (Object)null) { col = ((Component)val).GetComponentInChildren<Collider>(); } else if ((Object)(object)((Component)val).transform.parent != (Object)null && (Object)(object)((Component)val).GetComponentInParent<Collider>() != (Object)null) { col = ((Component)val).GetComponentInParent<Collider>(); } } Vector3 position = ((Component)cc).transform.position; Vector3 val2 = val.position - ((Component)cc).transform.position; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(position, ((Vector3)(ref val2)).normalized, ref val3, Vector3.Distance(((Component)cc).transform.position, val.position), LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { if ((Object)(object)((RaycastHit)(ref val3)).transform == (Object)(object)((Component)this).transform || (Object)(object)((RaycastHit)(ref val3)).transform == (Object)(object)((Component)val).transform) { targetable = true; } else { targetable = false; } } else { targetable = true; } } public void AddToTargetables() { if (!allTargetables.Contains(this)) { allTargetables.Add(this); } } public void RemoveFromTargetables() { if (allTargetables.Contains(this)) { allTargetables.Remove(this); } } public void OnEnable() { cc = MonoSingleton<CameraController>.Instance; AddToTargetables(); } public void Start() { AddToTargetables(); } public void OnDisable() { AddToTargetables(); } public void OnDestroy() { AddToTargetables(); } } [HarmonyPatch] public class AutoAimPatches { public enum TargetType { None, BlackHole, Enemy, Grenade } [HarmonyPrefix] [HarmonyPatch(typeof(CameraFrustumTargeter), "Update")] public static bool CFTUpdate(CameraFrustumTargeter __instance) { //IL_0090: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (!CameraFrustumTargeter.isEnabled || __instance.maxHorAim == 0f) { __instance.CurrentTarget = null; __instance.IsAutoAimed = false; return false; } Collider currentTarget = null; TargetType targetType = TargetType.None; float num = 999f; float num2 = 999f; float defaultFov = MonoSingleton<CameraController>.Instance.defaultFov; foreach (StraymodeTargetable allTargetable in allTargetables) { if (!allTargetable.targetable || (Object)(object)allTargetable.col == (Object)null) { continue; } float num3 = Vector3.Angle(((Component)allTargetable.col).transform.position - ((Component)__instance.camera).transform.position, ((Component)__instance.camera).transform.forward); if ((Object)(object)allTargetable.hole != (Object)null && num3 < num2 && num3 < __instance.maxHorAim * defaultFov) { num = num3; num2 = num3; currentTarget = allTargetable.col; targetType = TargetType.BlackHole; } if (targetType != TargetType.BlackHole) { if ((Object)(object)allTargetable.eid != (Ob